Make num_pages available

It returns the same value as total_pages and you can still use num_pages anywhere in the view.
closes #287, closes #284