Switch auto-ids to Flake IDs from random UUIDs

This PR starts from @GaelTadh's original PR (#6004) and just folds in the last round of feedback ... I think it's ready?
I might be wrong, but imagine that the clock is set to long in the future and then back again the the present. `last` will be greater than the current timestamp for a long time so `timestamp` will be always reset to `last`. And if we index more than 16M documents in that period of time then we will have duplicate identifiers?