Do not limit the Array (and attributes) nesting level by 2. Move helper functions out of jsml.dom.