Refactor query builder.
Merge pull request #16 from claroline/refactor-query-builder

Refactor query builder.