Fix the order X/Y in result.

Also, add KSTest class.
Improve KSTest to apply to the multi-dimension.