Some more code restructuring

This is mostly fairly harmless sorting of methods into groups of related
functionality. For example, all CQL query building is now in a section of
dbutils.