implemented isValid(Polygon)
fixed missing template declaration for isPlane
moved selfIntersects to algorithm/intersects