core: Opcode and encode_as_binary addtion to ubf api.