ENH: `Styler.apply(map)_index` made compatible with `Styler.to_excel`
This is a follow-on to #41893.

It makes the new `Styler.apply_index` and `Styler.applymap_index` methods compatible with `Styler.to_excel`. If the methods are not used the output reverts to the old format.

![Screen Shot 2021-06-14 at 10 58 47](https://user-images.githubusercontent.com/24256554/121866799-93016100-ccff-11eb-8bc8-124fd768e550.png)

**MultiIndex Case**

```python
midx = pd.MultiIndex.from_product([['ix', 'jy'], [0, 1], ['x3', 'z4']])
df = pd.DataFrame([np.arange(8)], columns=midx)
def highlight_x(s):
    return ["background-color: yellow;" if 'x' in v else "" for v in s]
df.style.apply_index(highlight_x, axis="columns", level=[0, 2]).to_excel("mi_test.xlsx")
```

![Screen Shot 2021-08-12 at 09 24 15](https://user-images.githubusercontent.com/24256554/129155325-1fe07a25-3f82-4063-8eba-b31ba725ce56.png)



# NOTE on TESTS

The tests for styler_to_excel were broken and were xfailed out of production in 2019. Since they dont work I have replaced them with some other, cleaner, tests and add tests relevant to this PR also.

Closes #25351
