Added register, login, and log out functionality
Added redirect to diary page on login
Added user flow control