adds where clause in documents count query
and other minor changes
begins sharer filter implementation