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).
Would be nice for this to have dependencies on newlines so `function` is easier to read.