Remove some globals from configuration tests
Fix / improve some assertions
Remove some more globals from tests

We are using blocks here so we have access to the environment around
them, no need for globals.