Extract pagination utilities and move to main beego.

I tested this manually with the posts pages.

This depends on astaxie/beego#837.

(See topic astaxie/beego#835).