Pass the code loc to the vis-event-handlers.
Added event-to-html-helper function.