Fix #170:  handle namespaces in queries

Review this PR *after* #254 is merged (it is based from that branch).

Fixes #170.
This method is just a getter.  It would be OK to me to have this be a read-only property.