Introduce a new abstract class for external function nodes.

This fixes the following bugs:

- 1st and 2nd ext fcn deriv nodes were incorrectly added to
  DataTree::external_function_node_map, because of the chaining of
  constructors.

- the following methods of FirstDerivExternalFunctionNode were not overloaded:
  toStatic(), buildSimilarExternalFunctionNode()

- the following methods of SecondDerivExternalFunctionNode were not overloaded:
  toStatic(), buildSimilarExternalFunctionNode(), compile(),
  compileExternalFunctionOutput()
Fix crash when the model contains 1st or 2nd ext fcn deriv nodes.

In the case where the external function computes itself its derivatives, the
TEF terms were not always created before being used, hence leading to a
preprocessor crash. This problem could only happen with ramsey_policy, because
otherwise the model does not contain derivatives of external functions.