refactor query.js
Merge branch 'master' into dev

Conflicts:
	lib/node/query.js