Refactored QueryCtrl to extract validation code into a service.  Also, added first step for enabling/disabling sources from the query builder.