Fixed registration, added support for message flashing, and implemented login and logout functions