Add format support for transaction querying

Add support for a ?format={json,hex,binary} parameter that determines
how transactions will be encoded. This is currently not supported
for blocks.