refactored $auth.login into a separate Local factory
moved signup method into local factory
moved logout and isAuthenticated to Local factory
refactored login.then() and authenticate.then() into Local.parseUser
server.js refactoring
added comments