More work on DOM Level2 events

- dispatchEvent follows standard now
- actually dsipatch events when modifying the dom