Working query tests
Fully tested with unit tests, added a bunch of helper methods. Updated jsDoc comments in index.js