Changed Element class so that it now has a factory method. Updated the related yacc files