refactoring controller,login and logout button

	user login and logout buttons are functional.
	Code has been refactored for readability.
Controller refactoring

	added register, login and logout functions to services.js