Track the behaviour's connection state

I realise this completely changes the API of this, but I'm proposing it as-is.

We want to be able to, from within the handler, get at the information held about the request/connection. As a result, I've added in the appropriate changes to the API and updated the provided examples to include a trivial example usage.