Update nfa_to_json.py

Finished. The algorithm seems correct and no extra parentheses are added. There are still extra epsilon transitions, but those would be a pain to remove.