assess run_count outside loop and gaurd against no categries in maj/minority
handle polygons outside of the extent of the raster; fixes #22