moved extendEnv and addBinding to toplevel, gave them type signatures for clarity