Cleanup, fix allocation errors

Cleaned up and worked on some core code for the VM, worked on the
function wrapping class, fixed an allocation error caused by copy
constructors