Created unit tests for testConfig() and refactored some files/code.