Fix support for session-based ownership of queries

Fix #118
Fix misspelling of asynchronous
Rename shared_query variable to simply query

Queries are just queries. The fact they are shared is a property of the
query.
Replace hasattr with getattr to increase robustness of test

getattr performs two assertions, the existence of the attribute and
whether the result if falsy. This was discovered in a test case when
the user attribute was present and failed when user.is_authenticated()
was evaluated.
Merge pull request #119 from cbmi/issue-118

Fix support for session-based ownership of queries