Refactor medDiffusionWorkspace.

Saves some redundancy and some hundred lines of code.