Make stub the default env; more tests; config refactoring