Improved terrain/lava performance. Created DISABLE_LOGGING compile switch. Small refactoring.