Ajax: remove event dependency from the ajax module

Closes gh-1695