clean up templating

Greatly simplifies index rendering and the no_auth_sitebase extension.