Refactoed mvd functions into dynamic library to share among plugins.