Fix for role updates not setting the role bits correctly.  Fixes crash
that occurs on reconnect.

Change-Id: I854adde2b226e31fafa1900fc1f7c7f87fdf55d3
Signed-off-by: Rob Adams <readams@readams.net>
Ensure that remote updates are handled promptly to check for
references to resolve.
Don't purge state when removing objects with positive refcounts and
add tests to verify.

Change-Id: I6c24007dee64dc366514a15fe9985d704749f0ed
Signed-off-by: Rob Adams <readams@readams.net>