A template engine for handling jQuery events