Login functionality added and better error messages

Finished login and logout functionality.
Fixed register function returning an error despite successful creation of a character.
Created templates for flash and error messages in the layout.