Frontend templating

Lots of edits here.