Move access to globals to the constructor, so they can be overwritten for testing using a setter.