Aded QueryBuilder and some tests