Add a function (getEnvironment) so that snaplets can get the environment...

This should close issue #86.