Various updates

Various fixed & updates. Also includes the new php template handler.

NB: this modifies the default output of pagination, can't think of any other breaking changes but worth checking locally before deploying to anything on production.