Add configuration file support

This makes all the options configurable, and adds support for loading the configuration from a file