Added AlgorithmUtility and start of LayerMetrics.

AlgorithmUtility puts the RNG into a static class.
LayerMetrics seperates the calculations of loop sizes and layer
boundaries from the compiler.