Adding separate class for handling configuration

This is then reused in both server and viewer.
 On the same time adding configuration options for listen host and port.

This is in part discussed in issue #25