Compare and exchange function for threading is now determined automatically by platform.h instead of hardcoding CPU arch.
Thread scheduling is now determined prior to thread creation, which is more complex but allows for greater control over how the thread is setup and run. Arbitrary defaults chosen for now, tweaking will occur once this runs on device.