Instruction serialization (and tests)