Rename Hal.serialize to Hal.encode