Leaflet Master branch compatibility update for new method of adding layers

changed extension of generic Class to Layer as well as updated addTo
method. This is a hack to continue to allow the bulk of the code written
to function in the .8 dev version of leaflet.