Adds nearest neighbor iterator and its unit tests