Rename env to environment. Add tests for overriding options.