Large update. Fix callback with token. Add some new functions. Made it work with phonegap...