Added pthread compatibility header and cleaned up some function declarations