Move username lookup functions from /port to /common

Per suggestion from Peter E and Alvaro