Fix rpc endianness
Add CScriptOp.(encode|decode)_op_n() unit tests

Fixed a few uncovered bugs