Refactoring mdl into its own plugin