Refactored the script a little bit so it doesn't make your eyes bleed as much.
Implemented quick and dirty table parsing and serialization.
Refactored file writing out of the 2 main steps and put it in its own function. So Step 1 no longer outputs a temporary file.