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).
It has to return `undefined` if it is not available, or the rest of the token system breaks. I wasn't confident that `localStorage.getItem` or `angular.fromJson` would returned undefined in both cases.