[#1701] Move and clean up search index tests
[#1701] Add tests for date fields, including a failing one for #1701
[#1701] Don't index empty dates as the current one

When parsing an empty string, dateutil will always use a default one,
which by default is now(). We use here a fake date to see if that was
the case, and if so remove the value from the dict to index.
[#1776] Fix bug when upserting [] on JSON column in the datastore

We were testing that the new value wasn't `None` using `if value`. As `[]` is a
falsy value, we never went through that `if` and ended up trying to run an
invalid SQL query.

This commit fixes that by explictly testing `if value is not None`.

This was first discovered in
http://stackoverflow.com/questions/24207065/inserting-empty-arrays-in-json-type-fields-in-datastore
[#1768] Convert group/organization_list to use group_dictize and take options. Some minor issues still.
[#1768] Add tests. Take advantage of dictization params where convenient. Refactor packages_field option.
[#1768] Tests fix / PEP8.
[#1768] Use package_count for the sort as well. Transition from legacy tests.
Update set-permissions in testing docs
Update set-permissions in paster docs
Add quotes to package ID and name in Solr queries to prevent Solr errors with custom dataset identifiers.
[#1436] Fix encoding error on user form when using email notifications

If the site title had special characters an encoding error was raised,
as the site title was an unicode string but the helper text wasn't. We
used the Jinja2 "string" filter to fix this. Translations should not be
affected so this can be backported.
Merge branch 'master' into 1701-date-field-index

Conflicts:
	ckan/new_tests/lib/search/test_index.py
Merge pull request #1840 from ckan/1768-organization-list

 organization_list all_fields misses out extras and users
[#1768] Remove stray commented code.
docker: Don't do configuration in the runfile

This commit extracts the config file generation and database
initialisation parts of the CKAN service into separate scripts which are
run at container "boot" rather than in the service file.

This is just a bit cleaner, and means that the scripts are guaranteed to
only run once on boot, rather than every time CKAN is started (e.g. if
CKAN crashes, runit will rerun the `run` file, but not the init scripts)

This also makes it easier to replace the configuration step with, for
example, a standalone Python script if this is deemed easier to
maintain.
Merge pull request #1860 from nickstenning/docker-split-run

docker: Don't do configuration in the runfile
Merge branch '1436-fix-encoding-in-user-form'
Merge branch '1701-date-field-index'
[#1701] PEP8