Support Command Line Arguments, refactor config

Refactors configuration to a common file, and adds support for command
line arguments. Command line arguments override the options specified in
the config file.