rewrite with coffeeScript, create loginForm directive, more aditions/modifications