WIP: Move stuff out of disptacher.c into transport.c