Automatic polymorphic queries

This change:
* makes superclasses know about all their subclasses, even multiple levels down
* Makes the queries for polymorphic documents include an $in query for the
  config_polymorphic field with the config_polymorphic_identity for all
  subclasses
* Adds fairly good tests for this feature

resolves #138