Improve thread management

It makes our thread pool sane and debuggable. 
This asserts that the internal thread pool is shutdown before booting and also tracks all threads while busy.

Comments please.