Fix thread headers, check the return value of pthread_create(), and wait for the threads at the end of the program.
Get rid of the infrastructure-centred directory: all the modules are now at the same level.