Use singledispatch instead of magic attibute to define mapper in MedeaEncoder