domain_id encapsulation and multi-domain capable, $db->query becomes dbQuery()