Fix flaky group_concat() query tests

The ordering of results returned by the  group_concat() tests were not deterministic. This
fixes the problem by switching the test cases to use a subquery with an order by.

Also fixed a similar problem with the limit and union tests.

Change-Id: Ibfe3c1597229cf5156af3a69b26bcce93abe28df
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3822
Reviewed-by: Lenni Kuff <lskuff@cloudera.com>
Tested-by: Lenni Kuff <lskuff@cloudera.com>
(cherry picked from commit 1e4dcb9fd7a1b2575e224a1162dea07b0f881d1f)
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3830
Tested-by: jenkins
Render all webpages via the template engine

This patch changes all remaining non-templated webpages to use the
templating engine to produce their HTML and text output. The main
motivation for this change is to make it much harder for unescaped output
to appear in HTML pages, where it might be interpreted by the browser as
e.g. JavaScript. The template engine automatically escapes all text.

As a side-effect, moving everything to the templating engine allows us
to remove the 'HTML' path from the webserver. Every callback now
produces Json and is rendered via a template.

This patch also changes the mechanism via which pages are presented to
the browser as text, rather than HTML. Any URL that includes the
argument '?raw' will automatically be rendered as text, not HTML, but
still passes through the template process. Any callback that wishes to
ensure that is only ever rendered as text (e.g. /jsonmetrics) has only
to set the special '__raw__' key in its Json output.

Finally, this patch removes the 'is_styled' parameter to
Register*Callback(); this logic belongs in the template, not inside the
webserver itself.

Change-Id: Ia33df77c52ebfa8125c5cf1fbcf40ea4b1da5497
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3810
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins
Import small fix for rendering bools in templates

Change-Id: I16a36635a9b42298c167e9abea515359119ea7bd
Reviewed-on: http://gerrit.sjc.cloudera.com:8080/3809
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: jenkins