Added pagination. Refactored to use DBAL, as required for the pager