Added user registration alongwith login/logout, error handling add_user_mysql

Improved error handling of add_user_mysql, and added basic registration for user.