Work in progress towards better support for piecewise p.d.f.s

This is done by firstly better handling the code to find the target sampled value and to handle the errors when it is missed, and secondly by code
which extracts roots from the piecewise conditions for use with the CVODE solver used to convert the p.d.f. to the c.d.f.

This is not yet finished - the solver does not yet use the root information provided to it, although the code is now being generated.