Allow blocks to register a json encoder