huge refactor #1

This is one in a long series of huge refactors. This one gets rid of a lot
of useless files, hosts most of our css and scripts locally, implements
template inheritance, and fixes hacky 'Are-you-sure-you-want-to-leave-
without-saving' behavior.