Save token to localStorage

Save token to localStorage as well as $cookieStore to support sites running in local filesystems with no cookie support (e.g. inside cordova apps).
If we were going to change all this, it would be a lot easier to change line 208 to a truthy check rather than `angular.isDefined`, as then it would not pick up returned null values either which is what we'd want.