Fixed bug in conversion script output dir

All around improvements to script, much better readability, added comments where needed, deleted commented-out code.