Debugging to fix e2e testing issue
Refactory a little bit.
Merge pull request #1426 from brendandburns/auth

Fix the scripts.
Merge pull request #1424 from dchen1107/cleanup

Fix e2e testing issue
Fix the scripts.