Change MutableObjectIterator to allow immutable objects

This makes it possible to remove the Reference<T> hack.