improved getStmtCount; did some refactoring

improved getStmtCount by using store-implemented COUNT
functionality instead of ask for all statements and then
count them using PHP.