Track the behaviour's internal state

This change allows the behaviour to inform the customised handler module to view the behaviour's internal state; this is in preparation to add a module to retrieve information about the internal state, to be done later.