DOM read/write microlib to avoid layout thrashing