Add NAT and transparent proxy support.

Also clean up a few things while we're in there.