Move all the query stuff to its own file.
Merge branch 'master' of https://github.com/matforest/tesseract

Conflicts:
	routes/index.js

used my index.js