Javascript fixes, started saving of editor values.

* Fixed for loop indices.
* Refactored code to make table rows read-only.
* Editor values now get sent to C++ in the same format they were
initially sent to Javascript.

The C++ side now needs to record the variable values in its own data
structures (that duplication isn't great, but the code generally needs
cleanup anyway), and to rederive the displayed metadata.