Check out the esri-leaflet library at https://github.com/Esri/esri-leaflet It is more complete, under active development, and uses much of the code from L.AGS.Dynamic
leaflet-ags
Leaflet extensions for viewing ArcGIS Server layers using Leaflet (http://leaflet.cloudmade.com).
NOTE: Requires Leaflet >= v0.4.x