change Element into an interface to facilitate switch to clojure data structures
remove unused type checking functions
move check for undefined values to static utility method
remove unnecessary redefinition of methods