Optimize setting new properties on objects

When a property on an object is set for the first time,
this triggers a change in internal class for the object.
Record that change in the lookup, and do the same transition
in the future.

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