Refactoring query logic to allow multiple queries

* Ryan helped split out this into a separate module
  for dbaas, leaving the original mysql.

Co-Authored-By: Ryan Phillips <ryan.phillips@rackspace.com>