Introduce per-profile preferences.

Individual profiles can now override global preferences. The look-up up
of a preference key for a given profile happens in this order: Profile
preferencess -> Base profile preferences (recursively) -> Global
preferences. Search stops when the key has been found.

Change-Id: Ia343acc67d326cb11dc8663651a7dbe8e46a7c74
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>