Convert DOM trees into compact JSON objects, and vice versa, as fast as possible.