Handler Functions

Added handler functions and changed the Login, Logout, Singup, Signin
pages use them.