DYN: neighbors: quick sort instead of merging in and out neighbors

This is slower, but conceptually simpler. Will add the merging back
soon.
DYN: neighbors function implemented