Split SLD function into three functions (color range, value range and XML string generation).  Added a legend creation function that will generate a small legend using the same style/range object with the color and value range functions.