Convert port finder

Clean up and enhance PortFinder.