Render index based on template

Closes #2.