Thread improvements. Added fallback threading libraries. Added a mutex (only implemented for winapi threads atm). Part II coming soon!