Alternate implementation

I've got around to port my implementation to the new extension API. It splits protocol implementation and logic, so it could still be reused for alternate logic approaches.

I know the code doesn't fit your style. Even if you don't merge it I would like some feedback so that we can converge towards a common codebase.