Added regtest case combining new IsPrime/DiscreteRange and FunctionalApplicationContext code