BUG Security::permissionFailure() fixing permissionDenied hook inconsistency

permissionDenied only works if Security::permissionFailure() is called when
there's currently no logged in Member. This fixes it so failed attempts
with logged in Member also includes the permissionDenied hook.

In addition, fix an undefined $member variable
Merge pull request #1756 from halkyon/permission_denied_hook

BUG Security::permissionFailure() fixing permissionDenied hook inconsistency
Fixing broken CoreTest when using silverstripe-cache for temp folder
Recursive folder creation in Upload
Include Zend_Locale_Format

Fix Zend_Locale_Format not being included.
Merge pull request #1941 from TheFrozenFire/patch-1

Include Zend_Locale_Format
BUG Fixing Filesystem::sync breaking subsite pages with same URLSegments

Filesystem::sync() tries to run through all pages, without caring
which subsite the page came from. The problem with this is
code in SiteTree::validURLSegment() will return invalid information,
as it will check if the page exists, thinking it does, return false,
then the page will get a new URLSegment written, e.g. "home-2".

Instead of disabling the subsite filter in Filesystem::sync(), this
fix will just loop through each subsite and sync each subsite's pages
individually before doing the main site.
Merge pull request #1886 from halkyon/filesystem_sync_subsites

BUG Fixing Filesystem::sync breaking subsite pages with same URLSegments
FIX Avoid unnecessary user_error when no controller set for friendly errors in Debug class
Updating docs to use SiteTree for aggregates with LastEdited example

Using SiteTree is faster, because it doesn't do any joining of Page
to get the aggregate, even though the LastEdited field is only on
SiteTree in the case of Page.
Merge pull request #1944 from patbolo/bugfix/debug-no-controller

FIX Avoid unnecessary user_error when no controller set for friendly err...
Added "saves into..." label to UploadField template

CMS users shouldn't need to guess where their files will end up.
Merge pull request #1940 from chillu/pulls/uploadfield-folder-label

Added "saves into..." label to UploadField template
Merge pull request #1939 from chillu/pulls/folder-creation

Recursive folder creation in Upload
FIX: If CSV column mapping maps to function, keep key value as key.

Fixes http://open.silverstripe.org/ticket/6473

When using CSVParser::$columnMapping to map columns to a callback action, it previously used the action name as the key value. This prevented users from defining multiple entries to the same callback. This patch retains those key values and simply runs the callback field name filter later on.
Code formatting / PHPDoc cleanup
Merge pull request #1875 from wilr/open6473

FIX: If CSV column mapping maps to function, keep key values
BUG GridField action onclick assuming URL without "?" character

Sometimes GridState URL will have a query string already appended,
e.g. "?local=en_GB", but the GridField javascript assumes there won't
be.

The result would be an action URL like:
"/my/url?locale=en_US?RelatedPage=123" which is obviously invalid.

The fix is to check that "?" exists in the GridState URL and use
"&" instead to connect the URLs if that's the case.
API UploadField functions on new records
Fixed regression from 1e5d40474d43ddb0ade22bbf7db5ec494b979fea (UploadField::canPreviewFolder). Updated documentation and configuration