Tidal effects and the environment dependence of halo assembly