Made the code work in a multi-threaded context.

This lets each thread hand its own CSV to make runtime fast. Its better
this way.