Move presentation stuff out of main template into mustache files

This is kind of a project design decision I made without checking first, but I was getting the feeling that the main template was too big, and I was thinking that eventually we might want to render server side anyway.  So I moved stuff into mustache templates.

Also, sorry for the sort of cluttered commit history - I didn't bring in your merge from my last pull request so things got messy.  But it should be good other than the history.