refs #9115. Warns and errors fixed. Perf tests.

I also added some peformance tests directly over the implementation of
findNeighbourIndexes. I noticed that one of the performance tests around
masking in the iterators was taking far too long, of the orer of 10s of
seconds. So I refactored that
peformance test to make the test itself do less work.