Re #2976 Allow `id` values to be generated from a function given attrs

Opening for discussion. This commit opens up a `generateId` function that has the sole job of taking `attrs` and returning the `id` value. This makes composite key and nested key support simple.