adds query specific params
adds self-invoking query function
Merge pull request #81 from scottjason/refactor-query

adds self-invoking query function