Feature/muwm 2329

Also includes the restructuring of code to more broadly improve testability.