Further rewriting

* Main script rewritten
* Separate settings file
* Menu entries for settings
* Ability to dynamically override view settings