Misc changes to /Index.

Trying to sort out the best way to break the code up into reusable pieces,
so that TagSearch will be able to use it.