Fix inverted queue asserts

Fix inverted queue asserts introduced in b378ed5692.
Minor changes (log levels, comments, imports)
Several updates to PubSub module
Merge pull request #172 from andrewtj/atj-fix-inverted-queue-asserts

Fix inverted queue asserts