Metropolitan Police Commissioner Sir Ian Blair, who has been dogged by controversy, has announced he is quitting his job.