Add a ports argument plus tests (some unimplmented)