refining kernelgenerator and the way it is used. added environment features to typechecker that may be removed