Tweakscale support (aka, total rewrite of half the core code). Fix for incorrect resource densities.