First working version of support for demography (no uids yet).