added query and utils; added mocha tests