Make all the templates inherit from a base template.

Also make some changes in the index view. Now it shows all the
categories ordered alphabetically.