Bind event handlers automatically by class or id