Create a UidFormatter class

The method with the signature `#allocateUID(String, UniqueIdType, short)` doesn't exist yet. It's something we should probably add though, but not in this PR. I moved the uid allocation to the before block at least.