Added support for storing tokens in localStorage with PhoneGap.