Adding nn_heap.[ch] and updating index.c

With the addition of nn_heap I was able to implement k-nearest neighbors
in index.c.