Improved kd tree splits (splitting happens in the dimension with the greatest spread); added some printf debugging and progress meters.