Added query builder, fixed some test namespace issues