Added Leaflet 0.8 compatibility

In Leaflet 0.8, custom layers should extend L.Layer instead of L.Class.
Compatibility with current Leaflet version is retained.