Add methods for getting the environment.
Fix up code for filepath.