replace delete! with splice! for arrays. fixes #3023
also adds the ability to replace the deleted items with a third argument