Replace case statements with class clauses with instance_of? checks. Fixes performance degredation due to module hierarchy traversal.
Merge pull request #370 from cheald/replace-module-case-with-instanceof

Replace case statements with class clauses with instance_of? checks.