How BlackBerry went from controlling the smartphone market to a phone of the past