Added a more abstract environment class which I hope will make i easier to
understand the lookup rules in isolation.