Started moving towards threads

Function that processes work (i.e. spits out the best value) is a
dedicated thread. Threading is "borrowed" from Jeff Garzik's cpuminer
<https://github.com/jgarzik/cpuminer>
Variable number of threads