move Tx related code to tx.jl; add byte array conversion for message object