Move DOM stuff to its own module