Allow dynamic legacy flag.

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | na
| License       | MIT
| Doc PR        | na

This is an idea to provide granularity of what legacy mode means (as controlled by the compat_layer) flag.

One sets the minimum acceptable legacy to support in `compat_layer`. `false` means no compat layer, `true` means any version or a version string like `1.2.5` means, only turn on legacy support for code marked legacy from 1.2.5 or higher.