fixed serialization of polygons
extra tests for criteria
fixed near and nearSphere to only work with Point