[test][is_valid] add test cases for polygons and multi-polygons inspired by email
exchanges with Barend Gehrels
[algorithms][is_valid] re-structure and polish code a bit;
check relative containment of rings only for rings that are not
associated with turns