Rewrite as a javascript object.
Rehack the input scheme to use a <textarea> so that the data is in a format more likely to be stashed in a text file.