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).
I actually added an `isObject` test, because it has to be an object to be able to access the token property