Adding a few new tests to make sure reference counting and reference retainment
is working as it should be.