Added KeyDefinition class and implementation.