Support ordering pages and articles when iterating in templates.
Order can be set to a metadata attribute or a sorting function.
Default to order by slug for articles and order by filename for pages.
Add test for PAGE_ORDER_BY
Merge remote-tracking branch 'remotes/malept/davidmarble-page-order-by' into davidmarble-page-order-by

Conflicts:
	docs/settings.rst
	pelican/generators.py
	pelican/tests/test_generators.py
Add missing methods
Address code review comments from PR getpelican/pelican#1348

The text about the sort-by-key function comes from:
https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange

Minor style cleanup as well.
Merge branch 'master' of https://github.com/getpelican/pelican into davidmarble-page-order-by
Addressed comments from @avaris in PR getpelican/pelican#1348
Fixes wrongly generated relative urls for pagination.

When `RELATIVE_URLS` is `True` and the `PAGINATION_PATTERNS` adds folder to the path, the relative urls to these pages does not respect these additional folders.

Example:
	Settings:
			RELATIVE_URLS = True
			PAGINATION_PATTERNS = (
					(1, '{base_name}/', '{base_name}/index.html'),
					(2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'),)

	Theme:
			<link href="{{ SITEURL }}/theme/css/style.css" rel="stylesheet">

If you are on page 2 then "{{ SITEURL }}/theme/css/style.css" expands to "./theme/css/style.css" instead of "./../../theme/css/style.css".

Fix:
Simply compute the relative url from the paginated url instead of the not paginated one.
Fixes #1395: extends pelican.utils.strftime with `-` prefix to strip leading zeros

Adds the ability to use `-` prefix with C89 format codes to strip any
leading zeros.
Documents DOCUTILS_SETTINGS and initializes it. Fixes #1425
Adds reference to SLUGIFY_SOURCE

When working on my site, I wanted SLUGIFY_SOURCE, but I came across PATH_METADATA first and enabled that for a while. Better to include the cross-reference where people can find it.
Fixes #1420: Handle multiple definitions of standard metadata for Markdown
Merge pull request #1445 from avaris/fix_1420

Fixes #1420: Handle multiple definitions of standard metadata for Markdown
Merge pull request #1438 from mlissner/patch-2

Add reference to SLUGIFY_SOURCE
Add feed_written signal
Merge pull request #1446 from avaris/enhanced_strftime

Fixes #1395: extends pelican.utils.strftime with `-` prefix to strip leading zeros
Merge pull request #1408 from arty-name/feed-written

Add feed_written signal
Merge pull request #1348 from vjousse/davidmarble-page-order-by

 Support ordering pages and articles when iterating in templates.
Merge pull request #1366 from Scheirle/paginated_relative_urls_fix2

Fixes wrongly generated relative urls for pagination.
Merge pull request #1426 from barrysteyn/DOCUTILS_SETTINGS

Documents DOCUTILS_SETTINGS and initializes it. Fixes #1425