Separate UI from presentation 

The main objective of this patch is to let each feature
be coded separately from each other, without needing to
put too much stuff inside the same functions.

The biggest changes are
  - Changed how new settings are defined
  - Moved some code around. Instead of having all constants in one place
    then all filtering functions, then the setting names in another,
    now all the code for each feature is in one place.
  - New "publish-subscribe" system for settings removes the need to call
    "update filters" all over the place.
  - All side effects are executed inside the "main" function.
 - Fixed all JSHint warnings.