Core/Objects: Rewritten UpdateMask class to perform bit operations faster at the cost of higher memory use and moved building the mask for packet to a separate method.

Closes #9127