Reorder title tag

Fixes #320

I've rewritten the way we do titles to use a helper method and be a bit cleaner. Also tests too!