Renamed prototypeRegex to prototypeName and removed prototypeLabelRegex entirely
Use closest() instead of parents()
Added consistency to use of $variables vs variables
Renamed event.prototype to event.triggeredPrototype (open for a better name, even if we completely rename the concept of prototypes in this javascript)
Removed return values from addToCollection (again, legacy from our system)
Moved the counter incrementing to addToCollection as it didnt make sense for _getPrototypeHtml to increment itself
Updated the javascript based on feedback and implemented the TODOs.
@jmclean and @Stof could you please review the changes, thanks.