Some high-level functions (thanks fredreichbier)

Also changed -lpthread flag to -pthread in the .use file