Make token switching phonegap friendly
Merge remote-tracking branch 'upstream/master'