New pagination model as object instead of array

- new functions to return anchor tags with link text for previous and
next pages
- updated default theme to support new pagination
- better handling of page urls with no page set or a page that doesn't
exist