DataProvider to support counting before fetching

Currently, calling $dataprovider->count() before $dataprovider->getData() throws an exception!