A bunch of coding and restructuring I did on an airplane

So none of it is tested as I had no Charon access but I'll start working on that today!
Yeah but this one is a PR to devel and the other to master. After I do a little more development and some more testing we can move these changes to master as well.