Use the inheritence cache in all getElementStyle methods.

Reduces unnecessary object allocation.
Readd the old ladder (dug out of the legacy branch)
Merge PR #1337 by @flo - ui cleanup