Login UI: clear sessionStorage first. Fixes #35
Cleaned up authentication code. Better login error messages. Fixes #34
Refactor client contacts code.

Fixed some bugs too.