Environment should hold path to working directory
Fix misc errors
Add more documentation