fixed accidentially swapped files, added clearFunctionEnv and
attachToFunction
clean ups, added some options
more cleanups