MULE-6843: finished initial round of moving code. Next steps are test cases and better docs