Add csv.py, fix threading and refactoring