* Major refactoring of logic. UI code still shitty since it will be rewritten.

* Added settings configuration
* Lots of documentation