Implement TCP port allocation

Signed-off-by: Jonathan Rudenberg <jonathan@titanous.com>