Added a three-color phase shift and moved SLD generation into a function.
Added vars into SLD function so styling can be generated from map request, now supports both 2 and 3 color phases.  Currently to use a 2 color phase the midpoint var must be passed as 'null'.