This patch creates a threads directory and separates out the contents of threads.py into separate files in the threads directory to make it easier to find and maintain.