Added unit tests.

Gets full coverage in config.py and profile.py.
Partial coverage of other modules.