Isolate the generic thread and heap code Tidyup's. Generic threading now working for x86, cortex-m0->m7.