Implemented expression caching (environment hash cache)

- needs more tests though