Contact indexing

This adds the indexing needed to grab the contacts and also updates the template to use the real data.
This is probably not the default sort we want, is it?