Try to convert JS objects to valid JSON (fixed)

This is a best effort approach using regular expressions. There may be a mature lib or better way to do this, but this will work in most cases.

Closes #2