[feature] Add onBeforeElemRestangularized config option

fixes #201
replaces #205