Add nearest neighbor search.
Cleanup module imports, use PriorityQueue.
Fix nnsearch and allow it to get the k nearest neighbors.

Cleanup tests a bit; they need more work though.