Refactor the cyclic reference stack as an object so that we can inject it into the logger constructor rather than having to pass it at every call