Switching out the queries to their own file

This will make writing tests easier. Also I don't like magic numbers or
strings in app code.
Using the queries file in tests