Feature: maxViewDistance, maxViewDistanceAtDark and maxDarknessToSeeUnits moved into ruleset

Member distance() uses sqrt() from standard library. Changed to distanceSq() because of performance http://assemblyrequired.crashworks.org/2009/10/16/timing-square-root/