Renamed KeyDefinition to AbstractKeyDefinition and added trait for building keys.