added forward declaration.
removed STANN library, now checking correctness of knn query code against a naive algorithm.

* added a new correctness check.
* small refactorings.
issue #571: not a bug, but the code deserves a comment and can be simplified.