Convert program into slice, refactor VM