Facebook has angered lawmakers for losing track of users' data and for not doing more to stop foreign meddling in the 2016 US presidential election.