[fabbione/kronosnet] 20e358: Move all threads code into threads.{c, h}