I have put some code up here: https://github.com/nilslp/adapt_framework/tree/issue/1804
if you get time, please have a look through and comment.
I have not as yet went through with a fine comb and sorted all duplicates and such but the majority of the files were not bad for combining code.
I have left a distinct break in the files where there was a merge of code from theme and core. I do intend to go through all of this and strip it all back to the bare minimum but I know that @oliverfoster
you are very familiar with this all and can probably kickstart it all in the right direction.