index() rework to use only one cache key

Reworked index() slightly to make caching simpler and only use one key.

(One note for users, remember to clear the cache after applying or else there are a few errors when displaying index pages.)