Make uid a field, restructure affine directory