Tidy up SQL query strings

In the list method of PublicBodyController, capitalize
the SQL keywords consistenly and don't include extraneous
whitespace in the strings.  (On the former point,
previously only some were - the convention is a matter of
some debate, but in this case the you editor's not doing
to do syntax highlighting of SQL so having the keywords
capitalized helps its readibility, I think.)

I wouldn't normally do this kind of cosmetic tidying up,
since it affects the tidiness of diffs and merges, but in
this case I'm going to change all these lines in the
next commit anyway, so that reasoning doesn't apply.
Make falling back to default locale in public body listings optional

As the code stood, the list method in PublicBodyController would only
return results that had translations of the public body in the default
locale.  This has a variety of problems if you're viewing pages in the
non-default locale - for example, the "first letter" links wouldn't
bring up the public bodies that began with that letter in the current
locale, only those that began with it in the default locale.

Ideally, every public body would be translated into every available
locale for the site, but there are cases where deployers wish to have
public body listings also include those from the default locale, in
case there are untralsated public bodies:

  https://groups.google.com/d/msg/alaveteli-dev/zUY_USaAMAM/M7KTQ9RC5YUJ

This commit makes the default behaviour to look for public body
listings only in the current locale, but if the new configuration
option PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE is set, then public
body listings will be looked for in both the current locale and the
default locale.

Fixes #1000
Fix locales used to find public bodies in AdminPublicBodyController

The locale returned from locale_from_params may be dash-separated,
(the I18n module convention) whereas those in the
public_body_translations table are underscore-separated.  The
AdminPublicBodyController was looking for dash-separated locales in
that table, so ensure that dashes are substituted for underscores
before using them in a query.
Add tests to assert the new public body listing behaviour

These tests will fail unless we have the new behaviour for public body
listing, which depend on the setting of
PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE.
Factor out the code to generate example single language public bodies

It's useful to be able to generate example public bodies that only
have translations in particular languages.
Don't display duplicate public bodies with the fallback

This introduces some raw SQL statement for the fallback case, but we
can't see an easy way to avoid that in this case.

This commit also adds some tests that assert the sorting and
non-duplication properties of the listing.

Thanks to Louise Crow for working out the SQL expression for
falling back to the default locale.
Merge branch 'public-body-locale-fallback' into rails-3-develop

Conflicts:
    app/controllers/public_body_controller.rb
    config/general.yml-example
    lib/configuration.rb