getProximateRacks(): move to functions.php

The sole purpose of this is to make it possible to stop linkmgmt.php
trying to include popup.php (and failing because of symlinks).

A long-term solution for similar cases could be a function that for a
given file name figures out the filesystem layout to include()/require()
the right file using the full path.