Added login and logout functionality.
Added a flash helper.