Trying to fix issue #29.
It escalated quickly, though. Additional problems addressed:
1. Moving all multiplexing to core, to simplify code elsewhere.
2. Introducing the "packet" data structure, to avoid having to recalculate
stuff all the time.
3. Sometimes we were dropping packets when we were supposed to accept them, and
maybe vice-versa. Now functions return a "verdict" enum, rather than true/false.
4. Lots of small bugs.