refactors josiah query.
cleanup.
adds docstring.
Merge pull request #14 from birkin/master

refactors josiah query.