Default CMSMain to Versioned::reading_stage("Stage")

Regression caused by https://github.com/silverstripe/silverstripe-framework/pull/2585
getViewer will now locate and use the correct templates for pages which don't have their own controller
Merge pull request #914 from micmania1/900-page-templates-without-controller

NEW Locate page template without needing to define a controller
Fixed ContentControllerTest
Documented magic properties/methods of SiteTree and SiteConfig.
Merge pull request #932 from yearofthegus/document-magic

Documented magic properties/methods of SiteTree and SiteConfig.
Numerous PHPDoc fixes.
Merge pull request #935 from yearofthegus/doctag_fixes

Numerous PHPDoc fixes.
Merge branch '3.1'
Merge remote-tracking branch 'origin/3.0' into 3.1
FIX: Fixed testing of theme switching.

The previous theme test relied on the existence of the tutorial theme, which has been removed.
I'ved added a couple of behat rules for scaffolding fake themes, and altered the test to use these.
FIX: Added proper state-restoration code to the ThemeContext:
Minor improvement of theme switching test performance.
Merge pull request #937 from sminnee/fix-theme-test

FIX: Fixed testing of theme switching.
Merge remote-tracking branch 'origin/3.1'
FIX: Fix failover to index template in ContentController::getViewer()

Historically, if you visit a foo action on Page, and Page_foo.ss doesn't exist, then it fails over
to Page.ss.  The introduction of ContentController::getViewer() broke this, but this patch adds a
test for this case and fixes it.

It was identified by build failures on silverstripe/userforms when tested against the master branch.
Merge pull request #941 from sminnee/fix-content-getviewer

FIX: Fix failover to index template in ContentController::getViewer()
API Move of codebase to parameterised query database abstraction layer
API Renamed DB static methods to properly conform to naming convention (lowercase, underscored)
API Replaced deprecated method