Fixes Issue #332

Fixes Issue #332. 

Adds OnPurge and OnStreamDelete to IPipelineHook. Key implementer is the OptimisticPipelineHook so that it's cache of tracked heads are cleaned up accordingly. The PipelineHooksAwarePersistanceDecorator is responsible for calling these additional extension points.

Honestly, feels a bit leaky to me, but can't think of a better way...