pagination improvements

+ jump to first and last pages added
+ code cleanups
+ bug fixes