Added user registration alongwith login/logout. Improved error
handling of add_user_mysql.