add support for ranges in objectStore.count/index.count. Fix Issue #53

This PR fixes issue #53 by adding support for ranges in the count methods of objectStores and indexes. Code originally by @whodies.