Finishing large changes

Final parts of massive overhaul, it is mostly now back in working order
aside from a few bugs