Deprecate mpl

Rebased and updated version of #1535.