Issue 96: Rework and fix bugs with Index Page

This started out as what could have been a small change to simply
make this feature work, but in understanding it, I ended up cleaning
a number of things up, implementing some performance improvements,
and (of course) fixing the bug we intended to fix.
pageindex: rename template variable from 'test' to 'pageindex'
Merge pull request #108 from sbenhaim/fix-index-links

Issue 96: Rework and fix bugs with Index Page