Adding environment unit tests to the standard testsuite.

Also, fixed small issue with an environment.js unit test.