Object polymorphism

This is what I was thinking of, which seems the most straightforward way, and should make RevParse-type functions possible.