Re #8023. Moving code from header to source.
Re #8023. Adding checks for MinValues and Maxvalues.
Re #8023. Changing test to look for exceptions.
Merge remote-tracking branch 'origin/feature/8023_converttomd_validateinputs'