don't write effects cache if we are testing
rename effect subroutines:
_insert_effect() -> insert_effect()
_add_effect()    -> append_effect()
append_effect() deletes the inapplicable "before" field