Fixed some errors in the VM
Encode and decode of mgc number shall use 16 bits
Adding tests to the instruction serialization