CORE-3989: did some refactoring and took a first stab at rewriting the UiAnalysisMarshaller