BUG Fix encoding of SearchForm::getSearchQuery

This made it awkward for user code to extract the query value for use in other applications; This would otherwise have to be xml decoded again.
Casting has been promoted to the templating level via `DBField::create_field` and a `SearchForm.casting` config setting.

Rebase of https://github.com/silverstripe/silverstripe-cms/pull/1005 against master
[ref: CWPBUG-153]