Make individual templates a bit clearer

Also a small breadcrumbs bug fix.
And removed sql specific code from one of the base templates.