Changes to how dialogs are displayed.
Change variable to a var.
Use dialog buttons.
Move login dialog code.
Clean up

* Update function names.
* Other minor clean up.
Support CSRF.
Make forms dialogs.
Persistant storage for settings.
Increase width of dialog box.