Fix userid in setting to cache

Store token for userid and loginhint.
Fix pwd expire field
Fix activity test to run on device without android keystore
Signed off with minor comments