Big cleanup, refactoring of data structures and bug fixing.
PortData is used instead of PortPair where reasonable.
Cleaned up PortUtil.