Move changes after review

Also refactor `DynamicObjectCollection` to use AssociativeArray, which simplifies the code some.