Lots of reworking and cleaning up

Large amounts of changes over largely everything.