Add `config.define_derived_metadata`.

Fixes #969 and supercedes #1089.
Merge pull request #1496 from rspec/define-derived-metadata

Define derived metadata.