[scala] Rework the traits to use an abstract value for self instead of requiring to be extended by Component/MarkupContainer.

Introduce implicit classes that provide the extra functionality for normal Java classes