DataProvider to support counting before fetching

Currently, calling $dataprovider->count() before $dataprovider->getData() throws an exception!
Merge pull request #8 from mjalajel/master

DataProvider to support counting objects before actually fetching them.