support login with keys flag and fix format of account data sent to browser

This should get us working with desktop sync again.

r? @ckarlof