modularize

make the core part of the virtual machine a class