Add parameter-less methods height and width to Element.

Such parameterless methods are quite common in Scala. By contrast,
methods defined with empty parentheses, such as def height(): Int,
are called empty-paren methods. The recommended convention is to
use a parameterless method whenever there are no parameters and
the method accesses mutable state only by reading fields of the
containing object (in particular, it does not change mutable
state), reminiscent of properties in C#.

This convention supports the uniform access principle, which says
that client code should not be affected by a decision to implement
an attribute as a field or method.  For instance, we could have
chosen to implement width and height as fields instead of methods,
simply by changing the def in each definition to a val:

abstract class Element {
  def contents: Array[String]
  val height = contents.length
  val width =
    if (height == 0) 0 else contents(0).length
}

The two pairs of definitions are completely equivalent from
a client’s point of view. The only difference is that field
accesses might be slightly faster than method invocations,
because the field values are pre-computed when the class is
initialized, instead of being computed on each method call. On the
other hand, the fields require extra memory space in each Element
object.  So it depends on the usage profile of a class whether an
attribute is better represented as a field or method, and that
usage profile might change over time. The point is that clients
of the Element class should not be affected
when its internal implementation changes.

In particular, a client of class Element should not need
to be rewritten if a field of that class gets changed into
an access function so long as the access function is pure, i.e.,
it does not have any side effects and does not depend
on mutable state. The client should not need to care either way.
Add an ArrayElement class that extends Element.

You initialize it with an array of strings, its lines, if you will,
and those lines become its contents, as far as its Element-hood is
concerned.