CRM-13487 declare  as global earlier
CRM-13554 - Improve string validation in the query engine
Backport of https://github.com/civicrm/civicrm-core/pull/1758
Merge pull request #49 from cividesk/CRM-13550

CRM-13550 Improve validation of options in the api
Merge pull request #48 from cividesk/CRM-13554

CRM-13554 - Improve string validation in the query engine
Merge pull request #43 from eileenmcnaughton/CRM-13487

CRM-13487 declare user as global earlier