Cvlfab 545 two part ui

refactor of onLogin code. Please see if you can find some bugs for me to fix.