Tests refactoring

Fixes some problems described in #27.

$exists query operator works wrong. Seems like it always behave like in case when True is passed into it.