Refactoring: nonce() and DISTARRAY_BASE_NAME

Just a couple of small refactorings done while working on other things:

1. Split a `nonce` function out of `uid` in `utils`.
2. Only define` DISTARRAY_BASE_NAME` in one place.