Send transaction as string

Also clean up some code.