split query operations into functions (untested)
Merge pull request #14 from slaporte/master

split up the query pages