Rewrote script in python.
Changed log format to use sqlite3 instead of text files.