Clean unused stuff out of thread.h and config.h and reorganize thread-pp.c to simplif...