Added a prototype head controller.

I'm doing some probably questionable things with locking and unlocking a mutex constantly in a loop, but I don't know of an easy better way.