Extract model and database to proper module
Refactor client interface factory code

Since a client controller often needs to modify the client view, it now has a
reference to it. Some minor problems and bugs were also fixed along the way.
Pass factory argument on in client app constructor

The usingTCP convenience method did not pass on the argument before, thus
custom server interface factories were effectively not possible this way.
Fix a couple of small bugs