Started major rewrite of environment.