Large pack of changes:
* rewrite settings page
* implement departments handling
* department switcher
* reformat source
* rewrite tests to use factory_boy
* lots of user/permission improvements