Test config v2

This PR adds tests for most configuration options. Because config is currently a module-level global, the tests are a tad complicated, but they should still help for refactoring.