More fucking around.

The plotting sample code is so ugly but it does the job.

The refractoring is still comming along. I think the API is reasonable now.