OCSADV-196: Fixed several bugs in ImPolygon and made changes as recommended by others.
OCSADV-196: Added test cases for ImPolygon.
OCSADV-196: Added scaladoc to clarify meaning of test cases.