Fixes some issues passing args to main()
Adds a test for the 'query' command
Allows passing a hash to query