Moved all environment related procedures to a seperate file.

I also refactored the code so that is easier to set the value of
variables within the interpreter and I changed the name for some of
the procedures to access into the different environments.