Cleanup thread_pool code; implement backtraces; work on runtime checks