More improvements to the async query pipeline.

This won't work for indirect implementations
see http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type
Also applies to other places with similar checks