#2507 Tidy code from r21993 and add a test for no nodes owned on a process

git-svn-id: https://chaste.cs.ox.ac.uk/svn/chaste/trunk@22048 b5f69653-2bf5-0310-8201-b0dafb8e1405