Refactored some more and fixed one or two bugs

As discussed. Fixed a few bugs that would occur when you had a large amount of objects or similar objects.
I've also refactored a bit more. Still unsure if my change of data to chunks in object_entry_groups was a good idea.