Fixed heavy memory leak in in "vm" module.

Changed code to work with Function vs vm.runInContext