Track both incoming and outgoing port assignments

When you write a compiler you need to know two things: what port do I
output on in order to reach one of my neighbors, and what port do I
input from in order to get data from that neighbor.

The old codebase couldn't answer both of these questions, this one
can.