[WIP] Split files into worker and main thread pieces.

Helps with memory usage.