Make OutputDatum and InputDatum top-level classes

...then ShapeOutputDatum and ShapeInputDatum are derived classes.