Templatize event handlers

Updates for Polymer/polymer#328