Port the first half of the delegate model code to v4

Change-Id: Ieda3de0a297ba15e4d6634a1123df27347830cfa
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>