Cleanup:

* Removing duplicate functions.
* Reorganization of ui-utils.js.
* Early preparation for eventual inclusion of server side settings
storage.
* Adding ` />` to `<img>` and `<input>` tags.