Making connection errors less scary when used as inventory

plus fixing how the query string is constructed to be less brittle.

Closes #38