Complete cleanup

Cleanup will continue.
Seperation of dead code was neccesary, this code can be run.