Extract getNeighbors into a publicly viewable function.

Write a bunch of tests for it.