Re #8023. Moving code from header to source.
Re #8023. Adding checks for MinValues and Maxvalues.
Merge branch 'feature/8023_converttomd_validateinputs' into develop