Ilan's code for preprocessing in a separate file (outside createdb.py)
It hasn't been tested yet!!!
Cleaning up