Added tests to command line argument parsing.

To make testing easier, refactored argument parsing and configuration management in separate classes. Single Responsibility Principle is also better followed, which does not hurt.

Adding tests, I found minor bugs in the verifications done on existence of configuration files, which I fixed.