Use jQuery event bindings instead of addEventListener

This is compatible with a wider range of browsers (including
IE<9)