store the event listeners using a hash if the context have a leaflet_id.

When removing a layer,the slowest part was to remove the event from the map.  For each event, the removeEventListener method had to loop the whole list.  With thousand of layers, it become very slow to do.  With a hash used has an index to find event listeners for a given leaflet id, its no more an issue.
Path CANVAS adds a click event if clickable but do not clear it on remove.  This adds the necessary remove listener.
use a property for index length because its slow to get the first property or get the length of a hash.
code convention
fix undefined error use cases
merge #1141 and clean it up