Add support for document.addEventListener

This also fixes an issue where removeEventListener left a wrapped listener.