Split territory utils out to their own file. See #3.