Fix for windows platforms

As stated in http://www.silverstripe.org/general-questions/show/24715#post323782 that line of code wasn't quite working for me so I did the change and it worked.

DIRECTORY_PATH was purpously avoided to ensure path normalizarion
FIX Removing dependence on cache dir name

Removing the dependence that cache dir is actually named `cache`
FIX Config settings returned to normal after publishing completes

When calling this function onAfterWrite of a DO, the site theme was used to render the CMS form. This fix corrects that by restoring all the config options that are changed
Merge remote-tracking branch '_dhensby/patch-1'
Merge remote-tracking branch '_torleif/patch-1'

Conflicts:
	code/controllers/StaticExporter.php
Merge remote-tracking branch '_ekersten/patch-1'