Added some documentation, improved dom.js, removed some unused stuff.