Add basic threads code

Tryin my hand in threading, so far I can create and wait on threads,
this code will soon be incorperated into parallelizing the GP.
Add thread state