Re-purposed query.js to be helper for waterline-sequel-orientdb