Add support for handling derived message types

Handler consuming a type will automatically consume all the derived types as well.