Improve eventFire and byclass functions

This improves eventFire function by removing unused compatibilities, and
fixes getting null context on function byclass, if element by id is not
found.