Heavy refactoring of command line, with support for configuraiton files