Add open port finding. [Refs #17]

I am not sure how to compile/test/install a local version, so this is untested code.