Fix deepcopies of _PrefixTrie

We only want to copy the structure of the nodes, we don't actually
want to copy the handlers.  In order to do this properly, we need
to implement a recursive copy ourselves.

I also needed to make the NodeList, which is used to store which
partition a handler is assigned to, copyable.

I've also added an explicit integration test that shows how the
bug can surface in practice, but I've also added a unit test
that shows the exact issue in test_hooks.py
Revert "Revert "Merge branch 'per-client-events' into develop""

This reverts commit 978614e459e0fab2d17889a996f220e23939d01f.
Merge branch 'per-client-events' into develop

* per-client-events:
  Fix deepcopies of _PrefixTrie