Adding tentative token support.

Also, better handling of timing, including timeouts.
Fixing local storage of user data and adding a missing file.

Plus some cleanup.