Added support for references in the summary by adding a new {refs|begin} tag.  Tidied a couple of templates which generated invalid html if a post had no tags.