Changing parallelism scheme

Changing the parallelism from foreach-skip-based to for-indexed-based approach.
Instead of referencing `spatialDensityFeatures[j + core]` repeatedly, create a new variable `Feature spatialDensityFeature = spatialDensityFeatures[j + core]` at the beginning of the `for`-loop. Very few other changes will be needed if you do this. Take the same approach with the other changes you've made.