fix mutability issues
add basic structure for executing opcodes