Create Pagination.php

separating functions to improve performance and organization