Set the Element class to use Element.elem.

Instead of referencing the classes directly, let Element use its
companion object's factory method, elem.
Make ArrayElement a private subclass of the Element companion object.
Make LineElement a private subclass of the Element companion object.
Make UniformElement a private subclass of the Element companion object.
Add Element utility methods widen and heighten.