Add tests for the config file parser

Refactor the config file parsing code into config.ml, and add some tests