Finished refactoring of DOM implementation.