Reworked process_csv, added docstrings. Turned process_csv into process_table, something a bit more
modular and readable. Added decent docstring to write_to_csv function