More compatible ways of adding and removing events on elements.

It's not quite as complete a solution as what jQuery provides, but it works.