Added InputDefinition and its tests and related classes.

Still needs to be documented.
Documented input definition code.