Feature: maxViewDistance, maxViewDistanceAtDark and maxDarknessToSeeUnits moved into ruleset

Optimization of distanceSq() in case of 2D calculation. Performance of 3D calculation will be the same.