Initial implementation of the new ports API, refs #136