Added new GUID implementation based on indexing. Modularized pthread specific functions.