[#718] Use error codes instead of relying on english error messages in datastore
[#642] Add spaces to log messages where they are missing
[#642] Use has_table_privilege and has_schema_privilege instead of experimental privilege checks.

Conflicts:
	ckanext/datastore/plugin.py
[#642] Make check functions consistent (return bool instead of raising exceptions)
[#642] Refactor datastore plugin configuration, improve (and fix ;-)) tests
[#642] Fix how the check for separate urls is ignored in legacy mode.
I put the check for the legacy mode in this function to make it testable.
[#642] Simplify check for debug mode, only create _foo once
[#718] Move pg error codes in a separate dictionary
[#718] Try to avoid PL/pgSQL since we cannot guarantee that is is activated
[#642] Refactored datastore config to make it easier to understand and easier to test
[#642] Ignore permission check in legacy mode and improve configuration tests
[#642] Inject `error_handler` instead of explicitly passing it as an argument, split large test into smaller tests
[#642] Add plugin loading and unloading. This does not fix the singleton issue but is better anyway.
[#642] Use single quotes where possible
[#642] Refactor and fix Datastore tests

Datastore is a SingletonPlugin, so it doesn't matter if we call
plugin.DatastorePlugin() many times: we always end up with the same instance.
I've added a workaround that, first, saves and unloads the current datastore
instance, then sets:

  pyutilib.component.core.PluginGlobals.singleton_services()[plugin.DatastorePlugin] = True

This will make plugin.DatastorePlugin not be a Singleton anymore, so any
subsequent calls to ckan.plugins.load('datastore') will create a new instance.
Then, in the next line, we create a new DatastorePlugin instance by loading
it, and save it into self.p and
pyutilib.component.core.PluginGlobals.singleton_services()[plugin.DatastorePlugin].
This turns DatastorePlugin into a Singleton again, and subsequent calls to
ckan.plugins.load('datastore') will return this new instance instead.

Then, in the teardown, we unload the current the datastore, which gets rid of
our test instance, and put the original datastore back in its place, so the
environment before setUp() is the same as after tearDown().

For InvalidUrlsOrPermissionsException, what I wanted was a way to check if
_check_urls_and_permissions() failed. I did this by overloading _log_or_raise()
with an unique Exception, and checking if it's raised. If so, I guarantee that
_log_or_raise() was called. This feels like too much boilerplate, but we don't
have a stub/mock library, so we have to write it.

Conflicts:
	ckanext/datastore/tests/test_configure.py
[#642] PEP8
Merge branch '718-datastore-depends-on-localisation-for-2.0' into release-v2.0