Refactor: Split up p_maputil.cpp moving these functions to better homes