Add ability to render XML, HTML or JSON

Still need to tidy up HTML output (to include integration with the
layout template) and sort out encoding of results (UTF-8)