Reorganized and cleaned up Leaflet directive