Query should be immutable

Implements #48 

**WARNING**: this is an API breaking change.