Hoist class definitions

They aren't scoped to the context (or example), so it's misleading to
define them there.
Simplify inheritance test
Fix #89; prevent subclasses from mutating superclass filters