Added onBeforeSerializeObject() model hook

Usefull to add extra dynamic fields to an object.