Added ElementFactory object to centralise production of element objects
and retrieval of their classes.