Remove loads of dead/unused code, commits separated per module

all in all about 2000 loc done with.