refactor out profile url generation into local_or_remote_person_path and use it everywhere. closes #2471