index: Port to template engine

Issue #71.