Refactor and remove legacy APIs/testing internals.
""""""""""""""""""""""""""""""""""""""""""""""""""

A number of internally used functions have been removed to aid with general
maintenance by reducing the number of ways in which it is possible to invoke
compilation, specifically:

* ``numba.core.compiler.compile_isolated`` is removed.
* ``numba.tests.support.TestCase::run_nullary_func`` is removed.
* ``numba.tests.support.CompilationCache`` is removed.

Additionally, the concept of "nested context" is removed from
``numba.core.registry.CPUTarget`` along with the implementation details.
Maintainers of target extensions (those using the
API in ``numba.core.target_extension`` to extend Numba support to
custom/synthetic hardware) should note that the same can be deleted from
target extension implementations of ``numba.core.descriptor.TargetDescriptor``
if it is present. i.e. the ``nested_context`` method and associated
implementation details can just be removed from the custom target's
``TargetDescriptor``.

Further, a bug was discovered, during the refactoring, in the typing of record
arrays. It materialised that two record types that only differed in their
mutability could alias, this has now been fixed.
