Moved most of the proximity code to a new package