London terrorist had twice been referred to police over his extremist views