Added support for ORM insert and update hooks

This commit also fixes an issue where the “created_at” and/or
“updated_at” timestamps wouldn’t be set in the event of a mass update
(Foo::update(...)) or when a record was created using a regular insert
(Foo::insert(...)).