Generalized OTStats to include filtering by any grammar