Factor out transacation handling of byte stream into separate file

This allows us to forward the transactions along another interface,
etc.