Ensure page parameters are valid.

Fixes #2042 by ensuring that:

- Invalid numbers aren't passed through to logic layer or paginator
- There is a default should an invalid number is passed.

Adds a _get_page_number() to the BaseController for re-use in all the controller subclasses.