Replaced lots of function with a single dynamic function
Added support for all ganglia 1.0 functions
Code tidy