reorganize translate function in HVMT for less code duplication
Fix codegen for eq/lt/gt commands in HVMT. StackTest now passes test script.