Add tests.
Fix some typos and handle arrays and objects in quoteString().