Added comments, improved testing GUI, cleaned KDTree implementation.