Implementing more of the mutexes in pthreads.
Partial fixes to the shitshow caused by pthreads and type declarations.
Minor changes to cheap for consistency, temporarily taking mutex and pthread out to make this compilable.
Modifying map to avoid using the heap and errno.