Adding support for query timeout

A couple of comments: 1) you don't need to add maxTime to the cursor from prepareCursor, since you've already added the maxTime in the prepareCursor method. And 2) as per my response to your question, I don't think the count method should be calling prepareCursor.  We'll make the assumption that maxTime, like the other cursor properties, won't be applied to countAll.
In summary, you shouldn't need to change the countAll method to add support for maxTime.