refactor(pagination): Put the current page in the middle for better UI/UX and refactor the code a bit as the .defer stuff was not required.
Make the tests pass
Merge in other branch