Tests: remove all the empty line whitespace
Data: move element cache to element[expando]

- avoid explicit cleanup
- reduce code

Fixes #11570