Tests for AuthCtrl

I've added tests for the authentication controller, and I've replaced `window` for `$window` to avoid triggering redirects when running the test suite.

I've chosen `chai` as the testing framework, is that ok?