Index: binary-improvements/MapRendering/API.cs
===================================================================
--- binary-improvements/MapRendering/API.cs	(revision 324)
+++ binary-improvements/MapRendering/API.cs	(revision 325)
@@ -1,16 +1,23 @@
-using System;
+using AllocsFixes.NetConnections.Servers.Web;
+using AllocsFixes.NetConnections.Servers.Web.Handlers;
 
-namespace MapRendering
-{
+namespace MapRendering {
 	public class API : IModApi {
+		public void InitMod () {
+			ModEvents.GameAwake.RegisterHandler (GameAwake);
+			ModEvents.GameStartDone.RegisterHandler (GameStartDone);
+			ModEvents.GameShutdown.RegisterHandler (GameShutdown);
+			ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
+		}
+
 		private void GameAwake () {
 			// ReSharper disable once ObjectCreationAsStatement
-			new AllocsFixes.NetConnections.Servers.Web.Web ();
-			AllocsFixes.NetConnections.Servers.Web.LogBuffer.Instance.GetType ();
+			new Web ();
+			LogBuffer.Instance.GetType ();
 		}
 
 		private void GameStartDone () {
-			if (AllocsFixes.NetConnections.Servers.Web.Handlers.ItemIconHandler.Instance != null) {
-				AllocsFixes.NetConnections.Servers.Web.Handlers.ItemIconHandler.Instance.LoadIcons ();
+			if (ItemIconHandler.Instance != null) {
+				ItemIconHandler.Instance.LoadIcons ();
 			}
 		}
@@ -23,12 +30,4 @@
 			AllocsFixes.MapRendering.MapRendering.RenderSingleChunk (_chunk);
 		}
-
-		public void InitMod () {
-			ModEvents.GameAwake.RegisterHandler (GameAwake);
-			ModEvents.GameStartDone.RegisterHandler (GameStartDone);
-			ModEvents.GameShutdown.RegisterHandler (GameShutdown);
-			ModEvents.CalcChunkColorsDone.RegisterHandler (CalcChunkColorsDone);
-		}
 	}
 }
-
Index: binary-improvements/MapRendering/AssemblyInfo.cs
===================================================================
--- binary-improvements/MapRendering/AssemblyInfo.cs	(revision 324)
+++ binary-improvements/MapRendering/AssemblyInfo.cs	(revision 325)
@@ -1,16 +1,15 @@
 using System.Reflection;
-using System.Runtime.CompilerServices;
 
 // Information about this assembly is defined by the following attributes. 
 // Change them to the values specific to your project.
 
-[assembly: AssemblyTitle("MapRendering")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("ci")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly: AssemblyTitle ("MapRendering")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("ci")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
 
 // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
@@ -18,5 +17,5 @@
 // and "{Major}.{Minor}.{Build}.*" will update just the revision.
 
-[assembly: AssemblyVersion("0.0.0.0")]
+[assembly: AssemblyVersion ("0.0.0.0")]
 
 // The following attributes are used to specify the signing key for the assembly, 
@@ -25,3 +24,2 @@
 //[assembly: AssemblyDelaySign(false)]
 //[assembly: AssemblyKeyFile("")]
-
Index: binary-improvements/MapRendering/Commands/EnableOpenIDDebug.cs
===================================================================
--- binary-improvements/MapRendering/Commands/EnableOpenIDDebug.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/EnableOpenIDDebug.cs	(revision 325)
@@ -1,28 +1,24 @@
 using System;
 using System.Collections.Generic;
+using AllocsFixes.NetConnections.Servers.Web;
 
-namespace AllocsFixes.CustomCommands
-{
-	public class EnableOpenIDDebug : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
+namespace AllocsFixes.CustomCommands {
+	public class EnableOpenIDDebug : ConsoleCmdAbstract {
+		public override string GetDescription () {
 			return "enable/disable OpenID debugging";
 		}
 
-		public override string[] GetCommands ()
-		{
-			return new string[] { "openiddebug" };
+		public override string[] GetCommands () {
+			return new[] {"openiddebug"};
 		}
 
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			try {
 				if (_params.Count != 1) {
-					SdtdConsole.Instance.Output ("Current state: " + AllocsFixes.NetConnections.Servers.Web.OpenID.debugOpenId);
+					SdtdConsole.Instance.Output ("Current state: " + OpenID.debugOpenId);
 					return;
 				}
 
-				AllocsFixes.NetConnections.Servers.Web.OpenID.debugOpenId = _params[0].Equals("1");
+				OpenID.debugOpenId = _params [0].Equals ("1");
 				SdtdConsole.Instance.Output ("Set OpenID debugging to " + _params [0].Equals ("1"));
 			} catch (Exception e) {
Index: binary-improvements/MapRendering/Commands/EnableRendering.cs
===================================================================
--- binary-improvements/MapRendering/Commands/EnableRendering.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/EnableRendering.cs	(revision 325)
@@ -2,27 +2,22 @@
 using System.Collections.Generic;
 
-namespace AllocsFixes.CustomCommands
-{
-	public class EnableRendering : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
+namespace AllocsFixes.CustomCommands {
+	public class EnableRendering : ConsoleCmdAbstract {
+		public override string GetDescription () {
 			return "enable/disable live map rendering";
 		}
 
-		public override string[] GetCommands ()
-		{
-			return new string[] { "enablerendering" };
+		public override string[] GetCommands () {
+			return new[] {"enablerendering"};
 		}
 
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			try {
 				if (_params.Count != 1) {
-					SdtdConsole.Instance.Output ("Current state: " + AllocsFixes.MapRendering.MapRendering.renderingEnabled);
+					SdtdConsole.Instance.Output ("Current state: " + MapRendering.MapRendering.renderingEnabled);
 					return;
 				}
 
-				AllocsFixes.MapRendering.MapRendering.renderingEnabled = _params[0].Equals("1");
+				MapRendering.MapRendering.renderingEnabled = _params [0].Equals ("1");
 				SdtdConsole.Instance.Output ("Set live map rendering to " + _params [0].Equals ("1"));
 			} catch (Exception e) {
Index: binary-improvements/MapRendering/Commands/ReloadWebPermissions.cs
===================================================================
--- binary-improvements/MapRendering/Commands/ReloadWebPermissions.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/ReloadWebPermissions.cs	(revision 325)
@@ -1,23 +1,19 @@
 using System;
 using System.Collections.Generic;
+using AllocsFixes.NetConnections.Servers.Web;
 
-namespace AllocsFixes.CustomCommands
-{
-	public class ReloadWebPermissions : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
+namespace AllocsFixes.CustomCommands {
+	public class ReloadWebPermissions : ConsoleCmdAbstract {
+		public override string GetDescription () {
 			return "force reload of web permissions file";
 		}
 
-		public override string[] GetCommands ()
-		{
-			return new string[] { "reloadwebpermissions" };
+		public override string[] GetCommands () {
+			return new[] {"reloadwebpermissions"};
 		}
 
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			try {
-				AllocsFixes.NetConnections.Servers.Web.WebPermissions.Instance.Load ();
+				WebPermissions.Instance.Load ();
 				SdtdConsole.Instance.Output ("Web permissions file reloaded");
 			} catch (Exception e) {
Index: binary-improvements/MapRendering/Commands/RenderMap.cs
===================================================================
--- binary-improvements/MapRendering/Commands/RenderMap.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/RenderMap.cs	(revision 325)
@@ -1,25 +1,18 @@
-using AllocsFixes.MapRendering;
 using System;
-using System.IO;
 using System.Collections.Generic;
 
-namespace AllocsFixes.CustomCommands
-{
-	public class RenderMap : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
+namespace AllocsFixes.CustomCommands {
+	public class RenderMap : ConsoleCmdAbstract {
+		public override string GetDescription () {
 			return "render the current map to a file";
 		}
 
-		public override string[] GetCommands ()
-		{
-			return new string[] { "rendermap" };
+		public override string[] GetCommands () {
+			return new[] {"rendermap"};
 		}
 
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			try {
-				AllocsFixes.MapRendering.MapRendering.Instance.RenderFullMap ();
+				MapRendering.MapRendering.Instance.RenderFullMap ();
 
 				SdtdConsole.Instance.Output ("Render map done");
Index: binary-improvements/MapRendering/Commands/WebPermissionsCmd.cs
===================================================================
--- binary-improvements/MapRendering/Commands/WebPermissionsCmd.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/WebPermissionsCmd.cs	(revision 325)
@@ -1,29 +1,24 @@
-using System;
 using System.Collections.Generic;
-using System.IO;
+using AllocsFixes.NetConnections.Servers.Web;
 
-using AllocsFixes.NetConnections.Servers.Web;
-using UnityEngine;
-
-namespace AllocsFixes.CustomCommands
-{
+namespace AllocsFixes.CustomCommands {
 	public class WebPermissionsCmd : ConsoleCmdAbstract {
 		public override string[] GetCommands () {
-			return new string[] { "webpermission" };
+			return new[] {"webpermission"};
 		}
-	
-		public override string GetDescription () { 
+
+		public override string GetDescription () {
 			return "Manage web permission levels";
 		}
-	
+
 		public override string GetHelp () {
 			return "Set/get permission levels required to access a given web functionality. Default\n" +
-				"level required for functions that are not explicitly specified is 0.\n" +
-				"Usage:\n" +
-				"   webpermission add <webfunction> <level>\n" +
-				"   webpermission remove <webfunction>\n" +
-				"   webpermission list";
+			       "level required for functions that are not explicitly specified is 0.\n" +
+			       "Usage:\n" +
+			       "   webpermission add <webfunction> <level>\n" +
+			       "   webpermission remove <webfunction>\n" +
+			       "   webpermission list";
 		}
-	
+
 		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			if (_params.Count >= 1) {
@@ -46,5 +41,5 @@
 			}
 		}
-	
+
 		private void ExecuteAdd (List<string> _params) {
 			if (_params.Count != 3) {
@@ -52,10 +47,10 @@
 				return;
 			}
-		
+
 			if (!WebPermissions.Instance.IsKnownModule (_params [1])) {
 				SdtdConsole.Instance.Output ("\"" + _params [1] + "\" is not a valid web function.");
 				return;
 			}
-		
+
 			int level;
 			if (!int.TryParse (_params [2], out level)) {
@@ -63,9 +58,9 @@
 				return;
 			}
-		
+
 			WebPermissions.Instance.AddModulePermission (_params [1], level);
 			SdtdConsole.Instance.Output (string.Format ("{0} added with permission level of {1}.", _params [1], level));
 		}
-	
+
 		private void ExecuteRemove (List<string> _params) {
 			if (_params.Count != 2) {
@@ -73,14 +68,14 @@
 				return;
 			}
-		
+
 			if (!WebPermissions.Instance.IsKnownModule (_params [1])) {
 				SdtdConsole.Instance.Output ("\"" + _params [1] + "\" is not a valid web function.");
 				return;
 			}
-		
+
 			WebPermissions.Instance.RemoveModulePermission (_params [1]);
 			SdtdConsole.Instance.Output (string.Format ("{0} removed from permissions list.", _params [1]));
 		}
-	
+
 		private void ExecuteList () {
 			SdtdConsole.Instance.Output ("Defined web function permissions:");
@@ -90,5 +85,4 @@
 			}
 		}
-
 	}
 }
Index: binary-improvements/MapRendering/Commands/WebTokens.cs
===================================================================
--- binary-improvements/MapRendering/Commands/WebTokens.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/WebTokens.cs	(revision 325)
@@ -1,20 +1,15 @@
-using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Text.RegularExpressions;
+using AllocsFixes.NetConnections.Servers.Web;
 
-using AllocsFixes.NetConnections.Servers.Web;
-using UnityEngine;
-
-namespace AllocsFixes.CustomCommands
-{
+namespace AllocsFixes.CustomCommands {
 	public class WebTokens : ConsoleCmdAbstract {
-		private static Regex validNameTokenMatcher = new Regex (@"^\w+$");
+		private static readonly Regex validNameTokenMatcher = new Regex (@"^\w+$");
 
 		public override string[] GetCommands () {
-			return new string[] { "webtokens" };
+			return new[] {"webtokens"};
 		}
-	
-		public override string GetDescription () { 
+
+		public override string GetDescription () {
 			return "Manage web tokens";
 		}
@@ -22,10 +17,10 @@
 		public override string GetHelp () {
 			return "Set/get webtoken permission levels. A level of 0 is maximum permission.\n" +
-				"Usage:\n" +
-				"   webtokens add <username> <usertoken> <level>\n" +
-				"   webtokens remove <username>\n" +
-				"   webtokens list";
+			       "Usage:\n" +
+			       "   webtokens add <username> <usertoken> <level>\n" +
+			       "   webtokens remove <username>\n" +
+			       "   webtokens list";
 		}
-	
+
 		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			if (_params.Count >= 1) {
@@ -61,5 +56,6 @@
 
 			if (!validNameTokenMatcher.IsMatch (_params [1])) {
-				SdtdConsole.Instance.Output ("Argument 'username' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
+				SdtdConsole.Instance.Output (
+					"Argument 'username' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
 				return;
 			}
@@ -71,5 +67,6 @@
 
 			if (!validNameTokenMatcher.IsMatch (_params [2])) {
-				SdtdConsole.Instance.Output ("Argument 'usertoken' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
+				SdtdConsole.Instance.Output (
+					"Argument 'usertoken' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
 				return;
 			}
@@ -82,7 +79,9 @@
 
 			WebPermissions.Instance.AddAdmin (_params [1], _params [2], level);
-			SdtdConsole.Instance.Output (string.Format ("Web user with name={0} and password={1} added with permission level of {2}.", _params [1], _params [2], level));
+			SdtdConsole.Instance.Output (string.Format (
+				"Web user with name={0} and password={1} added with permission level of {2}.", _params [1], _params [2],
+				level));
 		}
-	
+
 		private void ExecuteRemove (List<string> _params) {
 			if (_params.Count != 2) {
@@ -90,5 +89,5 @@
 				return;
 			}
-		
+
 			if (string.IsNullOrEmpty (_params [1])) {
 				SdtdConsole.Instance.Output ("Argument 'username' is empty.");
@@ -97,5 +96,6 @@
 
 			if (!validNameTokenMatcher.IsMatch (_params [1])) {
-				SdtdConsole.Instance.Output ("Argument 'username' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
+				SdtdConsole.Instance.Output (
+					"Argument 'username' may only contain characters (A-Z, a-z), digits (0-9) and underscores (_).");
 				return;
 			}
@@ -104,13 +104,13 @@
 			SdtdConsole.Instance.Output (string.Format ("{0} removed from web user permissions list.", _params [1]));
 		}
-	
+
 		private void ExecuteList () {
 			SdtdConsole.Instance.Output ("Defined webuser permissions:");
 			SdtdConsole.Instance.Output ("  Level: Name / Token");
 			foreach (WebPermissions.AdminToken at in WebPermissions.Instance.GetAdmins ()) {
-				SdtdConsole.Instance.Output (string.Format ("  {0,5}: {1} / {2}", at.permissionLevel, at.name, at.token));
+				SdtdConsole.Instance.Output (
+					string.Format ("  {0,5}: {1} / {2}", at.permissionLevel, at.name, at.token));
 			}
 		}
-	
 	}
 }
Index: binary-improvements/MapRendering/Commands/webstat.cs
===================================================================
--- binary-improvements/MapRendering/Commands/webstat.cs	(revision 324)
+++ binary-improvements/MapRendering/Commands/webstat.cs	(revision 325)
@@ -1,33 +1,34 @@
 using System;
 using System.Collections.Generic;
+using AllocsFixes.NetConnections.Servers.Web;
 
-namespace AllocsFixes.CustomCommands
-{
-	public class webstat : ConsoleCmdAbstract
-	{
-		public override string GetDescription ()
-		{
+namespace AllocsFixes.CustomCommands {
+	public class webstat : ConsoleCmdAbstract {
+		public override string GetDescription () {
 			return "DEBUG PURPOSES ONLY";
 		}
 
-		public override string[] GetCommands ()
-		{
-			return new string[] { "webstat" };
+		public override string[] GetCommands () {
+			return new[] {"webstat"};
 		}
 
-		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo)
-		{
+		public override void Execute (List<string> _params, CommandSenderInfo _senderInfo) {
 			try {
-				int curHandlers = AllocsFixes.NetConnections.Servers.Web.Web.currentHandlers;
-				int totalHandlers = AllocsFixes.NetConnections.Servers.Web.Web.handlingCount;
-				long totalTime = AllocsFixes.NetConnections.Servers.Web.Web.totalHandlingTime;
+				int curHandlers = Web.currentHandlers;
+				int totalHandlers = Web.handlingCount;
+				long totalTime = Web.totalHandlingTime;
 				SdtdConsole.Instance.Output ("Current Web handlers: " + curHandlers + " - total: " + totalHandlers);
-				SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs - average time: " + (totalTime / totalHandlers) + " µs");
+				SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs - average time: " +
+				                             totalTime / totalHandlers + " µs");
 
-				curHandlers = AllocsFixes.NetConnections.Servers.Web.WebCommandResult.currentHandlers;
-				totalHandlers = AllocsFixes.NetConnections.Servers.Web.WebCommandResult.handlingCount;
-				totalTime = AllocsFixes.NetConnections.Servers.Web.WebCommandResult.totalHandlingTime;
-				SdtdConsole.Instance.Output ("Current Web command handlers: " + curHandlers + " - total: " + totalHandlers);
-				SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs" + (totalHandlers > 0 ? " - average time: " + (totalTime / totalHandlers) + " µs" : ""));
+				curHandlers = WebCommandResult.currentHandlers;
+				totalHandlers = WebCommandResult.handlingCount;
+				totalTime = WebCommandResult.totalHandlingTime;
+				SdtdConsole.Instance.Output ("Current Web command handlers: " + curHandlers + " - total: " +
+				                             totalHandlers);
+				SdtdConsole.Instance.Output (" - Total time: " + totalTime + " µs" +
+				                             (totalHandlers > 0
+					                             ? " - average time: " + totalTime / totalHandlers + " µs"
+					                             : ""));
 			} catch (Exception e) {
 				Log.Out ("Error in webstat.Run: " + e);
Index: binary-improvements/MapRendering/MapRendering/Constants.cs
===================================================================
--- binary-improvements/MapRendering/MapRendering/Constants.cs	(revision 324)
+++ binary-improvements/MapRendering/MapRendering/Constants.cs	(revision 325)
@@ -1,16 +1,17 @@
-using System;
-
-namespace AllocsFixes.MapRendering
-{
-	public class Constants
-	{
+namespace AllocsFixes.MapRendering {
+	public class Constants {
 		public static int MAP_BLOCK_SIZE = 128;
 		public static int MAP_CHUNK_SIZE = 16;
 		public static int MAP_REGION_SIZE = 512;
-		public static int MAP_BLOCK_TO_CHUNK_DIV { get { return MAP_BLOCK_SIZE / MAP_CHUNK_SIZE; } }
-		public static int MAP_REGION_TO_CHUNK_DIV { get { return MAP_REGION_SIZE / MAP_CHUNK_SIZE; } }
 		public static int ZOOMLEVELS = 5;
 		public static string MAP_DIRECTORY = string.Empty;
+
+		public static int MAP_BLOCK_TO_CHUNK_DIV {
+			get { return MAP_BLOCK_SIZE / MAP_CHUNK_SIZE; }
+		}
+
+		public static int MAP_REGION_TO_CHUNK_DIV {
+			get { return MAP_REGION_SIZE / MAP_CHUNK_SIZE; }
+		}
 	}
 }
-
Index: binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs
===================================================================
--- binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs	(revision 324)
+++ binary-improvements/MapRendering/MapRendering/MapRenderBlockBuffer.cs	(revision 325)
@@ -1,34 +1,30 @@
 using System;
 using System.IO;
-using System.Threading;
+using AllocsFixes.FileCache;
 using UnityEngine;
 
-namespace AllocsFixes.MapRendering
-{
-	public class MapRenderBlockBuffer
-	{
-		private int zoomLevel;
+namespace AllocsFixes.MapRendering {
+	public class MapRenderBlockBuffer {
+		private readonly Texture2D blockMap = new Texture2D (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE);
+		private readonly MapTileCache cache;
+		private readonly Color nullColor = new Color (0, 0, 0, 0);
+		private readonly Texture2D zoomBuffer = new Texture2D (1, 1);
+		private readonly int zoomLevel;
 		private string currentBlockMap = string.Empty;
-		private Texture2D blockMap = new Texture2D (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE);
-		private Texture2D zoomBuffer = new Texture2D (1, 1);
-		private Color nullColor = new Color (0, 0, 0, 0);
-		private AllocsFixes.FileCache.MapTileCache cache;
 
-		public MapRenderBlockBuffer (int level, AllocsFixes.FileCache.MapTileCache cache)
-		{
+		public MapRenderBlockBuffer (int level, MapTileCache cache) {
 			zoomLevel = level;
 			this.cache = cache;
 		}
 
-		public void ResetBlock ()
-		{
+		public void ResetBlock () {
 			currentBlockMap = string.Empty;
 		}
 
-		public void SaveBlock ()
-		{
+		public void SaveBlock () {
 			try {
-				if (currentBlockMap.Length > 0)
+				if (currentBlockMap.Length > 0) {
 					saveTextureToFile (currentBlockMap);
+				}
 			} catch (Exception e) {
 				Log.Out ("Exception in MapRenderBlockBuffer.SaveBlock(): " + e);
@@ -36,9 +32,8 @@
 		}
 
-		public bool LoadBlock (Vector2i block)
-		{
+		public bool LoadBlock (Vector2i block) {
 			bool res = false;
 			lock (blockMap) {
-				string folder = Constants.MAP_DIRECTORY + "/" + (zoomLevel) + "/" + block.x;
+				string folder = Constants.MAP_DIRECTORY + "/" + zoomLevel + "/" + block.x;
 				string fileName = folder + "/" + block.y + ".png";
 				Directory.CreateDirectory (folder);
@@ -48,6 +43,8 @@
 					loadTextureFromFile (fileName);
 				}
+
 				currentBlockMap = fileName;
 			}
+
 			return res;
 		}
@@ -55,12 +52,13 @@
 		public void SetPart (Vector2i offset, int partSize, Color32[] pixels) {
 			if (offset.x + partSize > blockMap.width || offset.y + partSize > blockMap.height) {
-				Log.Error (string.Format ("MapBlockBuffer[{0}].SetPart ({1}, {2}, {3}) has blockMap.size ({4}/{5})", zoomLevel, offset, partSize, pixels.Length, blockMap.width, blockMap.height));
+				Log.Error (string.Format ("MapBlockBuffer[{0}].SetPart ({1}, {2}, {3}) has blockMap.size ({4}/{5})",
+					zoomLevel, offset, partSize, pixels.Length, blockMap.width, blockMap.height));
 				return;
 			}
+
 			blockMap.SetPixels32 (offset.x, offset.y, partSize, partSize, pixels);
 		}
 
-		public Color32[] GetHalfScaled ()
-		{
+		public Color32[] GetHalfScaled () {
 			zoomBuffer.Resize (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE);
 			zoomBuffer.SetPixels32 (blockMap.GetPixels32 ());
@@ -71,8 +69,8 @@
 		}
 
-		private void loadTextureFromFile (string _fileName)
-		{
+		private void loadTextureFromFile (string _fileName) {
 			byte[] array = cache.LoadTile (zoomLevel, _fileName);
-			if (array == null || !blockMap.LoadImage (array) || blockMap.height != Constants.MAP_BLOCK_SIZE || blockMap.width != Constants.MAP_BLOCK_SIZE) {
+			if (array == null || !blockMap.LoadImage (array) || blockMap.height != Constants.MAP_BLOCK_SIZE ||
+			    blockMap.width != Constants.MAP_BLOCK_SIZE) {
 				if (array != null) {
 					Log.Error ("Map image tile " + _fileName + " has been corrupted, recreating tile");
@@ -82,4 +80,5 @@
 					blockMap.Resize (Constants.MAP_BLOCK_SIZE, Constants.MAP_BLOCK_SIZE);
 				}
+
 				for (int x = 0; x < Constants.MAP_BLOCK_SIZE; x++) {
 					for (int y = 0; y < Constants.MAP_BLOCK_SIZE; y++) {
@@ -94,5 +93,4 @@
 			cache.SaveTile (zoomLevel, array);
 		}
-
 	}
 }
Index: binary-improvements/MapRendering/MapRendering/MapRendering.cs
===================================================================
--- binary-improvements/MapRendering/MapRendering/MapRendering.cs	(revision 324)
+++ binary-improvements/MapRendering/MapRendering/MapRendering.cs	(revision 325)
@@ -1,15 +1,46 @@
-using AllocsFixes.JSON;
 using System;
+using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using System.Text;
 using System.Threading;
+using System.Timers;
+using AllocsFixes.FileCache;
+using AllocsFixes.JSON;
 using UnityEngine;
-
-namespace AllocsFixes.MapRendering
-{
-	public class MapRendering
-	{
+using Object = UnityEngine.Object;
+
+namespace AllocsFixes.MapRendering {
+	public class MapRendering {
 		private static MapRendering instance;
+
+		private static readonly object lockObject = new object ();
+		public static bool renderingEnabled = true;
+		private readonly MapTileCache cache = new MapTileCache (Constants.MAP_BLOCK_SIZE);
+		private readonly Dictionary<Vector2i, Color32[]> dirtyChunks = new Dictionary<Vector2i, Color32[]> ();
+		private readonly MicroStopwatch msw = new MicroStopwatch ();
+		private readonly MapRenderBlockBuffer[] zoomLevelBuffers;
+		private Coroutine renderCoroutineRef;
+		private bool renderingFullMap;
+		private float renderTimeout = float.MaxValue;
+
+		private MapRendering () {
+			Constants.MAP_DIRECTORY = GameUtils.GetSaveGameDir () + "/map";
+
+			lock (lockObject) {
+				if (!LoadMapInfo ()) {
+					WriteMapInfo ();
+				}
+			}
+
+			cache.SetZoomCount (Constants.ZOOMLEVELS);
+
+			zoomLevelBuffers = new MapRenderBlockBuffer[Constants.ZOOMLEVELS];
+			for (int i = 0; i < Constants.ZOOMLEVELS; i++) {
+				zoomLevelBuffers [i] = new MapRenderBlockBuffer (i, cache);
+			}
+
+			renderCoroutineRef = ThreadManager.StartCoroutine (renderCoroutine ());
+		}
 
 		public static MapRendering Instance {
@@ -18,43 +49,14 @@
 					instance = new MapRendering ();
 				}
+
 				return instance;
 			}
 		}
 
-		private static object lockObject = new object ();
-		private MapRenderBlockBuffer[] zoomLevelBuffers;
-		private Dictionary<Vector2i, Color32[]> dirtyChunks = new Dictionary<Vector2i, Color32[]> ();
-		private bool renderingFullMap = false;
-		public static bool renderingEnabled = true;
-		private MicroStopwatch msw = new MicroStopwatch ();
-		private AllocsFixes.FileCache.MapTileCache cache = new AllocsFixes.FileCache.MapTileCache (Constants.MAP_BLOCK_SIZE);
-		private float renderTimeout = float.MaxValue;
-		private Coroutine renderCoroutineRef;
-
-		public static AllocsFixes.FileCache.MapTileCache GetTileCache() {
+		public static MapTileCache GetTileCache () {
 			return Instance.cache;
 		}
 
-		private MapRendering ()
-		{
-			Constants.MAP_DIRECTORY = GameUtils.GetSaveGameDir () + "/map";
-
-			lock (lockObject) {
-				if (!LoadMapInfo ())
-					WriteMapInfo ();
-			}
-
-			cache.SetZoomCount (Constants.ZOOMLEVELS);
-
-			zoomLevelBuffers = new MapRenderBlockBuffer[Constants.ZOOMLEVELS];
-			for (int i = 0; i < Constants.ZOOMLEVELS; i++) {
-				zoomLevelBuffers [i] = new MapRenderBlockBuffer (i, cache);
-			}
-
-			renderCoroutineRef = ThreadManager.StartCoroutine (renderCoroutine ());
-		}
-
-		public static void Shutdown ()
-		{
+		public static void Shutdown () {
 			if (Instance.renderCoroutineRef != null) {
 				ThreadManager.StopCoroutine (Instance.renderCoroutineRef);
@@ -63,23 +65,25 @@
 		}
 
-		public static void RenderSingleChunk (Chunk chunk)
-		{
+		public static void RenderSingleChunk (Chunk chunk) {
 			if (renderingEnabled) {
-				ThreadPool.UnsafeQueueUserWorkItem ((o) =>
-				{
+				ThreadPool.UnsafeQueueUserWorkItem (o => {
 					try {
 						if (!Instance.renderingFullMap) {
 							lock (lockObject) {
-								Chunk c = (Chunk)o;
+								Chunk c = (Chunk) o;
 								Vector3i cPos = c.GetWorldPos ();
-								Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE, cPos.z / Constants.MAP_CHUNK_SIZE);
+								Vector2i cPos2 = new Vector2i (cPos.x / Constants.MAP_CHUNK_SIZE,
+									cPos.z / Constants.MAP_CHUNK_SIZE);
 
 								ushort[] mapColors = c.GetMapColors ();
 								if (mapColors != null) {
-									Color32[] realColors = new Color32[Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE];
+									Color32[] realColors =
+										new Color32[Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE];
 									for (int i_colors = 0; i_colors < mapColors.Length; i_colors++) {
 										realColors [i_colors] = shortColorToColor32 (mapColors [i_colors]);
 									}
+
 									Instance.dirtyChunks [cPos2] = realColors;
+
 									//Log.Out ("Add Dirty: " + cPos2);
 								}
@@ -93,6 +97,5 @@
 		}
 
-		public void RenderFullMap ()
-		{
+		public void RenderFullMap () {
 			MicroStopwatch microStopwatch = new MicroStopwatch ();
 
@@ -101,14 +104,16 @@
 			Texture2D fullMapTexture = null;
 
-			Vector2i minChunk = default(Vector2i), maxChunk = default(Vector2i);
-			Vector2i minPos = default(Vector2i), maxPos = default(Vector2i);
+			Vector2i minChunk = default (Vector2i), maxChunk = default (Vector2i);
+			Vector2i minPos = default (Vector2i), maxPos = default (Vector2i);
 			int widthChunks, heightChunks, widthPix, heightPix;
-			getWorldExtent (rfm, out minChunk, out maxChunk, out minPos, out maxPos, out widthChunks, out heightChunks, out widthPix, out heightPix);
-
-			Log.Out (String.Format ("RenderMap: min: {0}, max: {1}, minPos: {2}, maxPos: {3}, w/h: {4}/{5}, wP/hP: {6}/{7}",
-			                        minChunk.ToString (), maxChunk.ToString (),
-			                        minPos.ToString (), maxPos.ToString (),
-			                        widthChunks, heightChunks,
-			                        widthPix, heightPix)
+			getWorldExtent (rfm, out minChunk, out maxChunk, out minPos, out maxPos, out widthChunks, out heightChunks,
+				out widthPix, out heightPix);
+
+			Log.Out (string.Format (
+				"RenderMap: min: {0}, max: {1}, minPos: {2}, maxPos: {3}, w/h: {4}/{5}, wP/hP: {6}/{7}",
+				minChunk.ToString (), maxChunk.ToString (),
+				minPos.ToString (), maxPos.ToString (),
+				widthChunks, heightChunks,
+				widthPix, heightPix)
 			);
 
@@ -121,17 +126,21 @@
 					Directory.Delete (Constants.MAP_DIRECTORY, true);
 				}
+
 				WriteMapInfo ();
 
 				renderingFullMap = true;
 
-				if (widthPix <= 8192 && heightPix <= 8192)
+				if (widthPix <= 8192 && heightPix <= 8192) {
 					fullMapTexture = new Texture2D (widthPix, heightPix);
-
-				Vector2i curFullMapPos = default(Vector2i);
-				Vector2i curChunkPos = default(Vector2i);
+				}
+
+				Vector2i curFullMapPos = default (Vector2i);
+				Vector2i curChunkPos = default (Vector2i);
 				for (curFullMapPos.x = 0; curFullMapPos.x < widthPix; curFullMapPos.x += Constants.MAP_CHUNK_SIZE) {
-					for (curFullMapPos.y = 0; curFullMapPos.y < heightPix; curFullMapPos.y += Constants.MAP_CHUNK_SIZE) {
-						curChunkPos.x = (curFullMapPos.x / Constants.MAP_CHUNK_SIZE) + minChunk.x;
-						curChunkPos.y = (curFullMapPos.y / Constants.MAP_CHUNK_SIZE) + minChunk.y;
+					for (curFullMapPos.y = 0;
+						curFullMapPos.y < heightPix;
+						curFullMapPos.y += Constants.MAP_CHUNK_SIZE) {
+						curChunkPos.x = curFullMapPos.x / Constants.MAP_CHUNK_SIZE + minChunk.x;
+						curChunkPos.y = curFullMapPos.y / Constants.MAP_CHUNK_SIZE + minChunk.y;
 
 						try {
@@ -141,11 +150,15 @@
 								ushort[] mapColors = c.GetMapColors ();
 								if (mapColors != null) {
-									Color32[] realColors = new Color32[Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE];
+									Color32[] realColors =
+										new Color32[Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE];
 									for (int i_colors = 0; i_colors < mapColors.Length; i_colors++) {
 										realColors [i_colors] = shortColorToColor32 (mapColors [i_colors]);
 									}
+
 									dirtyChunks [curChunkPos] = realColors;
-									if (fullMapTexture != null)
-										fullMapTexture.SetPixels32 (curFullMapPos.x, curFullMapPos.y, Constants.MAP_CHUNK_SIZE, Constants.MAP_CHUNK_SIZE, realColors);
+									if (fullMapTexture != null) {
+										fullMapTexture.SetPixels32 (curFullMapPos.x, curFullMapPos.y,
+											Constants.MAP_CHUNK_SIZE, Constants.MAP_CHUNK_SIZE, realColors);
+									}
 								}
 							}
@@ -159,5 +172,6 @@
 					}
 
-					Log.Out (String.Format ("RenderMap: {0}/{1} ({2}%)", curFullMapPos.x, widthPix, (int)((float)curFullMapPos.x / widthPix * 100)));
+					Log.Out (string.Format ("RenderMap: {0}/{1} ({2}%)", curFullMapPos.x, widthPix,
+						(int) ((float) curFullMapPos.x / widthPix * 100)));
 				}
 			}
@@ -166,5 +180,5 @@
 				byte[] array = fullMapTexture.EncodeToPNG ();
 				File.WriteAllBytes (Constants.MAP_DIRECTORY + "/map.png", array);
-				UnityEngine.Object.Destroy (fullMapTexture);
+				Object.Destroy (fullMapTexture);
 				fullMapTexture = null;
 			}
@@ -176,6 +190,5 @@
 		}
 
-		private void SaveAllBlockMaps (object source, System.Timers.ElapsedEventArgs e)
-		{
+		private void SaveAllBlockMaps (object source, ElapsedEventArgs e) {
 			for (int i = 0; i < Constants.ZOOMLEVELS; i++) {
 				zoomLevelBuffers [i].SaveBlock ();
@@ -183,5 +196,5 @@
 		}
 
-		private System.Collections.IEnumerator renderCoroutine () {
+		private IEnumerator renderCoroutine () {
 			while (true) {
 				lock (lockObject) {
@@ -189,14 +202,15 @@
 						renderTimeout = Time.time + 0.5f;
 					}
+
 					if (Time.time > renderTimeout || dirtyChunks.Count > 200) {
 						RenderDirtyChunks ();
 					}
 				}
+
 				yield return new WaitForSeconds (0.2f);
 			}
 		}
 
-		private void RenderDirtyChunks ()
-		{
+		private void RenderDirtyChunks () {
 			msw.ResetAndRestart ();
 
@@ -210,26 +224,30 @@
 				//Log.Out ("Start Dirty: " + chunkPos);
 
-				Vector2i block = default(Vector2i), blockOffset = default(Vector2i);
-				getBlockNumber (chunkPos, out block, out blockOffset, Constants.MAP_BLOCK_TO_CHUNK_DIV, Constants.MAP_CHUNK_SIZE);
+				Vector2i block = default (Vector2i), blockOffset = default (Vector2i);
+				getBlockNumber (chunkPos, out block, out blockOffset, Constants.MAP_BLOCK_TO_CHUNK_DIV,
+					Constants.MAP_CHUNK_SIZE);
 
 				zoomLevelBuffers [Constants.ZOOMLEVELS - 1].LoadBlock (block);
 
-				Vector2i v_block = default(Vector2i), v_blockOffset = default(Vector2i);
+				Vector2i v_block = default (Vector2i), v_blockOffset = default (Vector2i);
 				foreach (Vector2i v in keys) {
-					getBlockNumber (v, out v_block, out v_blockOffset, Constants.MAP_BLOCK_TO_CHUNK_DIV, Constants.MAP_CHUNK_SIZE);
+					getBlockNumber (v, out v_block, out v_blockOffset, Constants.MAP_BLOCK_TO_CHUNK_DIV,
+						Constants.MAP_CHUNK_SIZE);
 					if (v_block.Equals (block)) {
 						//Log.Out ("Dirty: " + v + " render: true");
 						chunksDone.Add (v);
 						if (dirtyChunks [v].Length != Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE) {
-							Log.Error (string.Format ("Rendering chunk has incorrect data size of {0} instead of {1}", dirtyChunks [v].Length, Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE));
-						}
-						zoomLevelBuffers [Constants.ZOOMLEVELS - 1].SetPart (v_blockOffset, Constants.MAP_CHUNK_SIZE, dirtyChunks [v]);
-					} else {
-						//Log.Out ("Dirty: " + v + " render: false");
-					}
-				}
-
-				foreach (Vector2i v in chunksDone)
+							Log.Error (string.Format ("Rendering chunk has incorrect data size of {0} instead of {1}",
+								dirtyChunks [v].Length, Constants.MAP_CHUNK_SIZE * Constants.MAP_CHUNK_SIZE));
+						}
+
+						zoomLevelBuffers [Constants.ZOOMLEVELS - 1]
+							.SetPart (v_blockOffset, Constants.MAP_CHUNK_SIZE, dirtyChunks [v]);
+					}
+				}
+
+				foreach (Vector2i v in chunksDone) {
 					dirtyChunks.Remove (v);
+				}
 
 				RenderZoomLevel (Constants.ZOOMLEVELS - 1, block);
@@ -239,12 +257,12 @@
 		}
 
-		private void RenderZoomLevel (int level, Vector2i innerBlock)
-		{
+		private void RenderZoomLevel (int level, Vector2i innerBlock) {
 			if (level > 0) {
-				Vector2i block = default(Vector2i), blockOffset = default(Vector2i);
+				Vector2i block = default (Vector2i), blockOffset = default (Vector2i);
 				getBlockNumber (innerBlock, out block, out blockOffset, 2, Constants.MAP_BLOCK_SIZE / 2);
 
 				zoomLevelBuffers [level - 1].LoadBlock (block);
-				zoomLevelBuffers [level - 1].SetPart (blockOffset, Constants.MAP_BLOCK_SIZE / 2, zoomLevelBuffers [level].GetHalfScaled ());
+				zoomLevelBuffers [level - 1].SetPart (blockOffset, Constants.MAP_BLOCK_SIZE / 2,
+					zoomLevelBuffers [level].GetHalfScaled ());
 
 				RenderZoomLevel (level - 1, block);
@@ -252,16 +270,15 @@
 		}
 
-		private void getBlockNumber (Vector2i innerPos, out Vector2i block, out Vector2i blockOffset, int scaleFactor, int offsetSize)
-		{
-			block = default(Vector2i);
-			blockOffset = default(Vector2i);
-			block.x = ((innerPos.x + 16777216) / scaleFactor) - (16777216 / scaleFactor);
-			block.y = ((innerPos.y + 16777216) / scaleFactor) - (16777216 / scaleFactor);
-			blockOffset.x = ((innerPos.x + 16777216) % scaleFactor) * offsetSize;
-			blockOffset.y = ((innerPos.y + 16777216) % scaleFactor) * offsetSize;
-		}
-
-		private void WriteMapInfo ()
-		{
+		private void getBlockNumber (Vector2i innerPos, out Vector2i block, out Vector2i blockOffset, int scaleFactor,
+			int offsetSize) {
+			block = default (Vector2i);
+			blockOffset = default (Vector2i);
+			block.x = (innerPos.x + 16777216) / scaleFactor - 16777216 / scaleFactor;
+			block.y = (innerPos.y + 16777216) / scaleFactor - 16777216 / scaleFactor;
+			blockOffset.x = (innerPos.x + 16777216) % scaleFactor * offsetSize;
+			blockOffset.y = (innerPos.y + 16777216) % scaleFactor * offsetSize;
+		}
+
+		private void WriteMapInfo () {
 			JSONObject mapInfo = new JSONObject ();
 			mapInfo.Add ("blockSize", new JSONNumber (Constants.MAP_BLOCK_SIZE));
@@ -272,6 +289,5 @@
 		}
 
-		private bool LoadMapInfo ()
-		{
+		private bool LoadMapInfo () {
 			if (File.Exists (Constants.MAP_DIRECTORY + "/mapinfo.json")) {
 				string json = File.ReadAllText (Constants.MAP_DIRECTORY + "/mapinfo.json", Encoding.UTF8);
@@ -279,9 +295,13 @@
 					JSONNode node = Parser.Parse (json);
 					if (node is JSONObject) {
-						JSONObject jo = (JSONObject)node;
-						if (jo.ContainsKey ("blockSize"))
-							Constants.MAP_BLOCK_SIZE = ((JSONNumber)jo ["blockSize"]).GetInt ();
-						if (jo.ContainsKey ("maxZoom"))
-							Constants.ZOOMLEVELS = ((JSONNumber)jo ["maxZoom"]).GetInt () + 1;
+						JSONObject jo = (JSONObject) node;
+						if (jo.ContainsKey ("blockSize")) {
+							Constants.MAP_BLOCK_SIZE = ((JSONNumber) jo ["blockSize"]).GetInt ();
+						}
+
+						if (jo.ContainsKey ("maxZoom")) {
+							Constants.ZOOMLEVELS = ((JSONNumber) jo ["maxZoom"]).GetInt () + 1;
+						}
+
 						return true;
 					}
@@ -292,34 +312,41 @@
 				}
 			}
+
 			return false;
 		}
 
 		private void getWorldExtent (RegionFileManager rfm, out Vector2i minChunk, out Vector2i maxChunk,
-	                                    out Vector2i minPos, out Vector2i maxPos,
-	                                    out int widthChunks, out int heightChunks,
-	                                    out int widthPix, out int heightPix)
-		{
-			minChunk = default(Vector2i);
-			maxChunk = default(Vector2i);
-			minPos = default(Vector2i);
-			maxPos = default(Vector2i);
+			out Vector2i minPos, out Vector2i maxPos,
+			out int widthChunks, out int heightChunks,
+			out int widthPix, out int heightPix) {
+			minChunk = default (Vector2i);
+			maxChunk = default (Vector2i);
+			minPos = default (Vector2i);
+			maxPos = default (Vector2i);
 
 			long[] keys = rfm.GetAllChunkKeys ();
-			int minX = Int32.MaxValue;
-			int minY = Int32.MaxValue;
-			int maxX = Int32.MinValue;
-			int maxY = Int32.MinValue;
+			int minX = int.MaxValue;
+			int minY = int.MaxValue;
+			int maxX = int.MinValue;
+			int maxY = int.MinValue;
 			foreach (long key in keys) {
 				int x = WorldChunkCache.extractX (key);
 				int y = WorldChunkCache.extractZ (key);
 
-				if (x < minX)
+				if (x < minX) {
 					minX = x;
-				if (x > maxX)
+				}
+
+				if (x > maxX) {
 					maxX = x;
-				if (y < minY)
+				}
+
+				if (y < minY) {
 					minY = y;
-				if (y > maxY)
+				}
+
+				if (y > maxY) {
 					maxY = y;
+				}
 			}
 
@@ -343,14 +370,12 @@
 		}
 
-		private static Color shortColorToColor (ushort col)
-		{
-			return new Color (((float)(col >> 10 & 31) / 31f), ((float)(col >> 5 & 31) / 31f), ((float)(col & 31) / 31f), 255);
-		}
-
-		private static Color32 shortColorToColor32 (ushort col)
-		{
-			byte r = (byte)(256 * (col >> 10 & 31) / 32);
-			byte g = (byte)(256 * (col >> 5 & 31) / 32);
-			byte b = (byte)(256 * (col & 31) / 32);
+		private static Color shortColorToColor (ushort col) {
+			return new Color (((col >> 10) & 31) / 31f, ((col >> 5) & 31) / 31f, (col & 31) / 31f, 255);
+		}
+
+		private static Color32 shortColorToColor32 (ushort col) {
+			byte r = (byte) (256 * ((col >> 10) & 31) / 32);
+			byte g = (byte) (256 * ((col >> 5) & 31) / 32);
+			byte b = (byte) (256 * (col & 31) / 32);
 			byte a = 255;
 			return new Color32 (r, g, b, a);
Index: binary-improvements/MapRendering/Web/API/ExecuteConsoleCommand.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/ExecuteConsoleCommand.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/ExecuteConsoleCommand.cs	(revision 325)
@@ -1,15 +1,11 @@
-using AllocsFixes.JSON;
-using AllocsFixes.PersistentData;
 using System;
-using System.Collections.Generic;
 using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class ExecuteConsoleCommand : WebAPI
-	{
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class ExecuteConsoleCommand : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			if (string.IsNullOrEmpty (req.QueryString ["command"])) {
-				resp.StatusCode = (int)HttpStatusCode.BadRequest;
+				resp.StatusCode = (int) HttpStatusCode.BadRequest;
 				Web.SetResponseTextContent (resp, "No command given");
 				return;
@@ -17,7 +13,9 @@
 
 			WebCommandResult.ResultType responseType =
-				req.QueryString ["raw"] != null ? WebCommandResult.ResultType.Raw :
-				(req.QueryString ["simple"] != null ? WebCommandResult.ResultType.ResultOnly :
-					WebCommandResult.ResultType.Full);
+				req.QueryString ["raw"] != null
+					? WebCommandResult.ResultType.Raw
+					: (req.QueryString ["simple"] != null
+						? WebCommandResult.ResultType.ResultOnly
+						: WebCommandResult.ResultType.Full);
 
 			string commandline = req.QueryString ["command"];
@@ -28,13 +26,14 @@
 
 			if (command == null) {
-				resp.StatusCode = (int)HttpStatusCode.NotImplemented;
+				resp.StatusCode = (int) HttpStatusCode.NotImplemented;
 				Web.SetResponseTextContent (resp, "Unknown command");
 				return;
 			}
 
-			AdminToolsCommandPermissions atcp = GameManager.Instance.adminTools.GetAdminToolsCommandPermission (command.GetCommands ());
+			AdminToolsCommandPermissions atcp =
+				GameManager.Instance.adminTools.GetAdminToolsCommandPermission (command.GetCommands ());
 
 			if (permissionLevel > atcp.PermissionLevel) {
-				resp.StatusCode = (int)HttpStatusCode.Forbidden;
+				resp.StatusCode = (int) HttpStatusCode.Forbidden;
 				Web.SetResponseTextContent (resp, "You are not allowed to execute this command");
 				return;
@@ -51,3 +50,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetAllowedCommands.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetAllowedCommands.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetAllowedCommands.cs	(revision 325)
@@ -1,16 +1,14 @@
+using System.Net;
 using AllocsFixes.JSON;
-using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetAllowedCommands : WebAPI {
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			JSONObject result = new JSONObject ();
 			JSONArray entries = new JSONArray ();
 			foreach (IConsoleCommand cc in SdtdConsole.Instance.GetCommands ()) {
-				AdminToolsCommandPermissions atcp = GameManager.Instance.adminTools.GetAdminToolsCommandPermission (cc.GetCommands ());
+				AdminToolsCommandPermissions atcp =
+					GameManager.Instance.adminTools.GetAdminToolsCommandPermission (cc.GetCommands ());
 				if (permissionLevel <= atcp.PermissionLevel) {
 					string cmd = string.Empty;
@@ -20,4 +18,5 @@
 						}
 					}
+
 					JSONObject cmdObj = new JSONObject ();
 					cmdObj.Add ("command", new JSONString (cmd));
@@ -38,3 +37,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetAnimalsLocation.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetAnimalsLocation.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetAnimalsLocation.cs	(revision 325)
@@ -1,44 +1,41 @@
-﻿using AllocsFixes.JSON;
+﻿using System.Collections.Generic;
+using System.Net;
+using AllocsFixes.JSON;
 using AllocsFixes.LiveData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-    class GetAnimalsLocation : WebAPI
-    {
-		private List<EntityAnimal> animals = new List<EntityAnimal> ();
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	internal class GetAnimalsLocation : WebAPI {
+		private readonly List<EntityAnimal> animals = new List<EntityAnimal> ();
 
-        public override void HandleRequest(HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-        {
-            JSONArray animalsJsResult = new JSONArray();
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			JSONArray animalsJsResult = new JSONArray ();
 
 			Animals.Instance.Get (animals);
-			for (int i = 0; i < animals.Count; i++)
-			{
+			for (int i = 0; i < animals.Count; i++) {
 				EntityAnimal entity = animals [i];
-                Vector3i position = new Vector3i(entity.GetPosition());
+				Vector3i position = new Vector3i (entity.GetPosition ());
 
-                JSONObject jsonPOS = new JSONObject();
-                jsonPOS.Add("x", new JSONNumber(position.x));
-                jsonPOS.Add("y", new JSONNumber(position.y));
-                jsonPOS.Add("z", new JSONNumber(position.z));
+				JSONObject jsonPOS = new JSONObject ();
+				jsonPOS.Add ("x", new JSONNumber (position.x));
+				jsonPOS.Add ("y", new JSONNumber (position.y));
+				jsonPOS.Add ("z", new JSONNumber (position.z));
 
-                JSONObject pJson = new JSONObject();
-                pJson.Add("id", new JSONNumber(entity.entityId));
+				JSONObject pJson = new JSONObject ();
+				pJson.Add ("id", new JSONNumber (entity.entityId));
 
-                if (!string.IsNullOrEmpty(entity.EntityName))
-                    pJson.Add("name", new JSONString(entity.EntityName));
-                else
-                    pJson.Add("name", new JSONString("animal class #" + entity.entityClass.ToString()));
+				if (!string.IsNullOrEmpty (entity.EntityName)) {
+					pJson.Add ("name", new JSONString (entity.EntityName));
+				} else {
+					pJson.Add ("name", new JSONString ("animal class #" + entity.entityClass));
+				}
 
-                pJson.Add("position", jsonPOS);
+				pJson.Add ("position", jsonPOS);
 
-                animalsJsResult.Add(pJson);
-            }
-            
-            WriteJSON(resp, animalsJsResult);
-        }
-    }
+				animalsJsResult.Add (pJson);
+			}
+
+			WriteJSON (resp, animalsJsResult);
+		}
+	}
 }
Index: binary-improvements/MapRendering/Web/API/GetHostileLocation.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetHostileLocation.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetHostileLocation.cs	(revision 325)
@@ -1,44 +1,41 @@
-﻿using AllocsFixes.JSON;
+﻿using System.Collections.Generic;
+using System.Net;
+using AllocsFixes.JSON;
 using AllocsFixes.LiveData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-    class GetHostileLocation : WebAPI
-    {
-		private List<EntityEnemy> enemies = new List<EntityEnemy> ();
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	internal class GetHostileLocation : WebAPI {
+		private readonly List<EntityEnemy> enemies = new List<EntityEnemy> ();
 
-        public override void HandleRequest(HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-        {
-            JSONArray hostilesJsResult = new JSONArray();
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			JSONArray hostilesJsResult = new JSONArray ();
 
 			Hostiles.Instance.Get (enemies);
-			for (int i = 0; i < enemies.Count; i++)
-            {
+			for (int i = 0; i < enemies.Count; i++) {
 				EntityEnemy entity = enemies [i];
-                Vector3i position = new Vector3i(entity.GetPosition());
+				Vector3i position = new Vector3i (entity.GetPosition ());
 
-                JSONObject jsonPOS = new JSONObject();
-                jsonPOS.Add("x", new JSONNumber(position.x));
-                jsonPOS.Add("y", new JSONNumber(position.y));
-                jsonPOS.Add("z", new JSONNumber(position.z));
+				JSONObject jsonPOS = new JSONObject ();
+				jsonPOS.Add ("x", new JSONNumber (position.x));
+				jsonPOS.Add ("y", new JSONNumber (position.y));
+				jsonPOS.Add ("z", new JSONNumber (position.z));
 
-                JSONObject pJson = new JSONObject();
-                pJson.Add("id", new JSONNumber(entity.entityId));
+				JSONObject pJson = new JSONObject ();
+				pJson.Add ("id", new JSONNumber (entity.entityId));
 
-                if (!string.IsNullOrEmpty(entity.EntityName))
-                    pJson.Add("name", new JSONString(entity.EntityName));
-                else
-                    pJson.Add("name", new JSONString("enemy class #" + entity.entityClass.ToString()));
+				if (!string.IsNullOrEmpty (entity.EntityName)) {
+					pJson.Add ("name", new JSONString (entity.EntityName));
+				} else {
+					pJson.Add ("name", new JSONString ("enemy class #" + entity.entityClass));
+				}
 
-                pJson.Add("position", jsonPOS);
+				pJson.Add ("position", jsonPOS);
 
-                hostilesJsResult.Add(pJson);
-            }
+				hostilesJsResult.Add (pJson);
+			}
 
-            WriteJSON(resp, hostilesJsResult);
-        }
-    }
+			WriteJSON (resp, hostilesJsResult);
+		}
+	}
 }
Index: binary-improvements/MapRendering/Web/API/GetLandClaims.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetLandClaims.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetLandClaims.cs	(revision 325)
@@ -1,12 +1,11 @@
+using System.Collections.Generic;
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetLandClaims : WebAPI {
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			string requestedSteamID = string.Empty;
 
@@ -15,5 +14,5 @@
 				requestedSteamID = req.QueryString ["steamid"];
 				if (requestedSteamID.Length != 17 || !ulong.TryParse (requestedSteamID, out lViewersSteamID)) {
-					resp.StatusCode = (int)HttpStatusCode.BadRequest;
+					resp.StatusCode = (int) HttpStatusCode.BadRequest;
 					Web.SetResponseTextContent (resp, "Invalid SteamID given");
 					return;
@@ -25,5 +24,5 @@
 
 			bool bViewAll = WebConnection.CanViewAllClaims (permissionLevel);
-            
+
 			JSONObject result = new JSONObject ();
 			result.Add ("claimsize", new JSONNumber (GamePrefs.GetInt (EnumGamePrefs.LandClaimSize)));
@@ -35,20 +34,20 @@
 			if (!string.IsNullOrEmpty (requestedSteamID) || !bViewAll) {
 				if (!string.IsNullOrEmpty (requestedSteamID) && !bViewAll) {
-					ownerFilters = new LandClaimList.OwnerFilter[] {
+					ownerFilters = new[] {
 						LandClaimList.SteamIdFilter (user.SteamID.ToString ()),
 						LandClaimList.SteamIdFilter (requestedSteamID)
 					};
 				} else if (!bViewAll) {
-					ownerFilters = new LandClaimList.OwnerFilter[] { LandClaimList.SteamIdFilter (user.SteamID.ToString ()) };
+					ownerFilters = new[] {LandClaimList.SteamIdFilter (user.SteamID.ToString ())};
 				} else {
-					ownerFilters = new LandClaimList.OwnerFilter[] { LandClaimList.SteamIdFilter (requestedSteamID) };
+					ownerFilters = new[] {LandClaimList.SteamIdFilter (requestedSteamID)};
 				}
 			}
+
 			LandClaimList.PositionFilter[] posFilters = null;
 
-			Dictionary<PersistentData.Player, List<Vector3i>> claims = LandClaimList.GetLandClaims (ownerFilters, posFilters);
+			Dictionary<Player, List<Vector3i>> claims = LandClaimList.GetLandClaims (ownerFilters, posFilters);
 
-			foreach (KeyValuePair<PersistentData.Player, List<Vector3i>> kvp in claims) {
-
+			foreach (KeyValuePair<Player, List<Vector3i>> kvp in claims) {
 				try {
 					JSONObject owner = new JSONObject ();
@@ -83,3 +82,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetLog.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetLog.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetLog.cs	(revision 325)
@@ -1,12 +1,10 @@
-using AllocsFixes.JSON;
-using AllocsFixes.PersistentData;
-using System;
 using System.Collections.Generic;
 using System.Net;
+using AllocsFixes.JSON;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetLog : WebAPI {
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			int firstLine, lastLine;
 
@@ -39,3 +37,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetPlayerInventories.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayerInventories.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetPlayerInventories.cs	(revision 325)
@@ -1,14 +1,12 @@
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
 namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetPlayerInventories : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			JSONArray AllInventoriesResult = new JSONArray ();
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
-			JSONArray AllInventoriesResult = new JSONArray ();
-            
 			foreach (string sid in PersistentContainer.Instance.Players.SteamIDs) {
 				Player p = PersistentContainer.Instance.Players [sid, false];
@@ -55,6 +53,4 @@
 			WriteJSON (resp, AllInventoriesResult);
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetPlayerInventory.cs	(revision 325)
@@ -1,15 +1,13 @@
+using System.Collections.Generic;
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetPlayerInventory : WebAPI {
-
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			if (req.QueryString ["steamid"] == null) {
-				resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+				resp.StatusCode = (int) HttpStatusCode.InternalServerError;
 				Web.SetResponseTextContent (resp, "No SteamID given");
 				return;
@@ -18,5 +16,5 @@
 			Player p = PersistentContainer.Instance.Players [req.QueryString ["steamid"], false];
 			if (p == null) {
-				resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+				resp.StatusCode = (int) HttpStatusCode.InternalServerError;
 				Web.SetResponseTextContent (resp, "Invalid or unknown SteamID given");
 				return;
@@ -87,11 +85,10 @@
 					jsonItem.Add ("qualitycolor", new JSONString (QualityInfo.GetQualityColorHex (_item.quality)));
 				}
+
 				return jsonItem;
-			} else {
-				return new JSONNull ();
 			}
+
+			return new JSONNull ();
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetPlayerList.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayerList.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetPlayerList.cs	(revision 325)
@@ -1,4 +1,2 @@
-using AllocsFixes.JSON;
-using AllocsFixes.PersistentData;
 using System;
 using System.Collections.Generic;
@@ -6,24 +4,18 @@
 using System.Net;
 using System.Text.RegularExpressions;
-
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class GetPlayerList : WebAPI
-	{
-		private static Regex numberFilterMatcher = new Regex (@"^(>=|=>|>|<=|=<|<|==|=)?\s*([0-9]+(\.[0-9]*)?)$");
-		private enum NumberMatchType {
-			Equal,
-			Greater,
-			GreaterEqual,
-			Lesser,
-			LesserEqual
-		}
-
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
-            AdminTools admTools = GameManager.Instance.adminTools;
-            user = user ?? new WebConnection ("", "", 0L);
-
-            bool bViewAll = WebConnection.CanViewAllPlayers (permissionLevel);
+using AllocsFixes.JSON;
+using AllocsFixes.PersistentData;
+
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class GetPlayerList : WebAPI {
+		private static readonly Regex numberFilterMatcher =
+			new Regex (@"^(>=|=>|>|<=|=<|<|==|=)?\s*([0-9]+(\.[0-9]*)?)$");
+
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			AdminTools admTools = GameManager.Instance.adminTools;
+			user = user ?? new WebConnection ("", "", 0L);
+
+			bool bViewAll = WebConnection.CanViewAllPlayers (permissionLevel);
 
 			// TODO: Sort (and filter?) prior to converting to JSON ... hard as how to get the correct column's data? (i.e. column name matches JSON object field names, not source data)
@@ -46,26 +38,28 @@
 
 			foreach (string sid in playersList.SteamIDs) {
-                Player p = playersList [sid, false];
-
-                ulong player_steam_ID = 0L;
-                if (!ulong.TryParse (sid, out player_steam_ID))
-                    player_steam_ID = 0L;
-
-                if ((player_steam_ID == user.SteamID) || bViewAll) {
-                    JSONObject pos = new JSONObject ();
-                    pos.Add("x", new JSONNumber (p.LastPosition.x));
-                    pos.Add("y", new JSONNumber (p.LastPosition.y));
-                    pos.Add("z", new JSONNumber (p.LastPosition.z));
-
-                    JSONObject pJson = new JSONObject ();
-                    pJson.Add("steamid", new JSONString (sid));
-					pJson.Add("entityid", new JSONNumber (p.EntityID));
-                    pJson.Add("ip", new JSONString (p.IP));
-                    pJson.Add("name", new JSONString (p.Name));
-                    pJson.Add("online", new JSONBoolean (p.IsOnline));
-                    pJson.Add("position", pos);
+				Player p = playersList [sid, false];
+
+				ulong player_steam_ID = 0L;
+				if (!ulong.TryParse (sid, out player_steam_ID)) {
+					player_steam_ID = 0L;
+				}
+
+				if (player_steam_ID == user.SteamID || bViewAll) {
+					JSONObject pos = new JSONObject ();
+					pos.Add ("x", new JSONNumber (p.LastPosition.x));
+					pos.Add ("y", new JSONNumber (p.LastPosition.y));
+					pos.Add ("z", new JSONNumber (p.LastPosition.z));
+
+					JSONObject pJson = new JSONObject ();
+					pJson.Add ("steamid", new JSONString (sid));
+					pJson.Add ("entityid", new JSONNumber (p.EntityID));
+					pJson.Add ("ip", new JSONString (p.IP));
+					pJson.Add ("name", new JSONString (p.Name));
+					pJson.Add ("online", new JSONBoolean (p.IsOnline));
+					pJson.Add ("position", pos);
 
 					pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime));
-					pJson.Add ("lastonline", new JSONString (p.LastOnline.ToUniversalTime ().ToString ("yyyy-MM-ddTHH:mm:ssZ")));
+					pJson.Add ("lastonline",
+						new JSONString (p.LastOnline.ToUniversalTime ().ToString ("yyyy-MM-ddTHH:mm:ssZ")));
 					pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1));
 
@@ -76,9 +70,10 @@
 						banned = new JSONBoolean (false);
 					}
+
 					pJson.Add ("banned", banned);
 
 					playerList.Add (pJson);
-                }
-            }
+				}
+			}
 
 			IEnumerable<JSONObject> list = playerList;
@@ -124,5 +119,6 @@
 		}
 
-		private IEnumerable<JSONObject> ExecuteFilter (IEnumerable<JSONObject> _list, string _filterCol, string _filterVal) {
+		private IEnumerable<JSONObject> ExecuteFilter (IEnumerable<JSONObject> _list, string _filterCol,
+			string _filterVal) {
 			if (_list.Count () == 0) {
 				return _list;
@@ -131,13 +127,18 @@
 			if (_list.First ().ContainsKey (_filterCol)) {
 				Type colType = _list.First () [_filterCol].GetType ();
-				if (colType == typeof(JSONNumber)) {
+				if (colType == typeof (JSONNumber)) {
 					return ExecuteNumberFilter (_list, _filterCol, _filterVal);
-				} else if (colType == typeof(JSONBoolean)) {
+				}
+
+				if (colType == typeof (JSONBoolean)) {
 					bool value = _filterVal.Trim ().ToLower () == "true";
 					return _list.Where (line => (line [_filterCol] as JSONBoolean).GetBool () == value);
-				} else if (colType == typeof(JSONString)) {
+				}
+
+				if (colType == typeof (JSONString)) {
 					// regex-match whole ^string$, replace * by .*, ? by .?, + by .+
 					_filterVal = _filterVal.Replace ("*", ".*").Replace ("?", ".?").Replace ("+", ".+");
 					_filterVal = "^" + _filterVal + "$";
+
 					//Log.Out ("GetPlayerList: Filter on String with Regex '" + _filterVal + "'");
 					Regex matcher = new Regex (_filterVal, RegexOptions.IgnoreCase);
@@ -145,9 +146,11 @@
 				}
 			}
+
 			return _list;
 		}
 
 
-		private IEnumerable<JSONObject> ExecuteNumberFilter (IEnumerable<JSONObject> _list, string _filterCol, string _filterVal) {
+		private IEnumerable<JSONObject> ExecuteNumberFilter (IEnumerable<JSONObject> _list, string _filterCol,
+			string _filterVal) {
 			// allow value (exact match), =, ==, >=, >, <=, <
 			Match filterMatch = numberFilterMatcher.Match (_filterVal);
@@ -157,46 +160,47 @@
 				double epsilon = value / 100000;
 				switch (filterMatch.Groups [1].Value) {
-				case "":
-				case "=":
-				case "==":
-					matchType = NumberMatchType.Equal;
-					break;
-				case ">":
-					matchType = NumberMatchType.Greater;
-					break;
-				case ">=":
-				case "=>":
-					matchType = NumberMatchType.GreaterEqual;
-					break;
-				case "<":
-					matchType = NumberMatchType.Lesser;
-					break;
-				case "<=":
-				case "=<":
-					matchType = NumberMatchType.LesserEqual;
-					break;
-				default:
-					matchType = NumberMatchType.Equal;
-					break;
-				}
-				return _list.Where (delegate(JSONObject line) {
+					case "":
+					case "=":
+					case "==":
+						matchType = NumberMatchType.Equal;
+						break;
+					case ">":
+						matchType = NumberMatchType.Greater;
+						break;
+					case ">=":
+					case "=>":
+						matchType = NumberMatchType.GreaterEqual;
+						break;
+					case "<":
+						matchType = NumberMatchType.Lesser;
+						break;
+					case "<=":
+					case "=<":
+						matchType = NumberMatchType.LesserEqual;
+						break;
+					default:
+						matchType = NumberMatchType.Equal;
+						break;
+				}
+
+				return _list.Where (delegate (JSONObject line) {
 					double objVal = (line [_filterCol] as JSONNumber).GetDouble ();
 					switch (matchType) {
-					case NumberMatchType.Greater:
-						return objVal > value;
-					case NumberMatchType.GreaterEqual:
-						return objVal >= value;
-					case NumberMatchType.Lesser:
-						return objVal < value;
-					case NumberMatchType.LesserEqual:
-						return objVal <= value;
-					case NumberMatchType.Equal:
-					default:
-						return NearlyEqual (objVal, value, epsilon);
+						case NumberMatchType.Greater:
+							return objVal > value;
+						case NumberMatchType.GreaterEqual:
+							return objVal >= value;
+						case NumberMatchType.Lesser:
+							return objVal < value;
+						case NumberMatchType.LesserEqual:
+							return objVal <= value;
+						case NumberMatchType.Equal:
+						default:
+							return NearlyEqual (objVal, value, epsilon);
 					}
 				});
-			} else {
-				Log.Out ("GetPlayerList: ignoring invalid filter for number-column '{0}': '{1}'", _filterCol, _filterVal);
-			}
+			}
+
+			Log.Out ("GetPlayerList: ignoring invalid filter for number-column '{0}': '{1}'", _filterCol, _filterVal);
 			return _list;
 		}
@@ -210,51 +214,54 @@
 			if (_list.First ().ContainsKey (_sortCol)) {
 				Type colType = _list.First () [_sortCol].GetType ();
-				if (colType == typeof(JSONNumber)) {
+				if (colType == typeof (JSONNumber)) {
 					if (_ascending) {
 						return _list.OrderBy (line => (line [_sortCol] as JSONNumber).GetDouble ());
-					} else {
-						return _list.OrderByDescending (line => (line [_sortCol] as JSONNumber).GetDouble ());
-					}
-				} else if (colType == typeof(JSONBoolean)) {
+					}
+
+					return _list.OrderByDescending (line => (line [_sortCol] as JSONNumber).GetDouble ());
+				}
+
+				if (colType == typeof (JSONBoolean)) {
 					if (_ascending) {
 						return _list.OrderBy (line => (line [_sortCol] as JSONBoolean).GetBool ());
-					} else {
-						return _list.OrderByDescending (line => (line [_sortCol] as JSONBoolean).GetBool ());
-					}
-				} else {
-					if (_ascending) {
-						return _list.OrderBy (line => line [_sortCol].ToString ());
-					} else {
-						return _list.OrderByDescending (line => line [_sortCol].ToString ());
-					}
-				}
-			}
+					}
+
+					return _list.OrderByDescending (line => (line [_sortCol] as JSONBoolean).GetBool ());
+				}
+
+				if (_ascending) {
+					return _list.OrderBy (line => line [_sortCol].ToString ());
+				}
+
+				return _list.OrderByDescending (line => line [_sortCol].ToString ());
+			}
+
 			return _list;
 		}
 
 
-		private bool NearlyEqual(double a, double b, double epsilon)
-		{
-			double absA = Math.Abs(a);
-			double absB = Math.Abs(b);
-			double diff = Math.Abs(a - b);
-
-			if (a == b)
-			{ // shortcut, handles infinities
+		private bool NearlyEqual (double a, double b, double epsilon) {
+			double absA = Math.Abs (a);
+			double absB = Math.Abs (b);
+			double diff = Math.Abs (a - b);
+
+			if (a == b) {
 				return true;
-			} 
-			else if (a == 0 || b == 0 || diff < Double.Epsilon) 
-			{
-				// a or b is zero or both are extremely close to it
-				// relative error is less meaningful here
+			}
+
+			if (a == 0 || b == 0 || diff < double.Epsilon) {
 				return diff < epsilon;
 			}
-			else
-			{ // use relative error
-				return diff / (absA + absB) < epsilon;
-			}
-		}
-
+
+			return diff / (absA + absB) < epsilon;
+		}
+
+		private enum NumberMatchType {
+			Equal,
+			Greater,
+			GreaterEqual,
+			Lesser,
+			LesserEqual
+		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetPlayersLocation.cs	(revision 325)
@@ -1,16 +1,12 @@
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class GetPlayersLocation : WebAPI
-	{
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
-            AdminTools admTools = GameManager.Instance.adminTools;
-            user = user ?? new WebConnection ("", "", 0L);
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class GetPlayersLocation : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			AdminTools admTools = GameManager.Instance.adminTools;
+			user = user ?? new WebConnection ("", "", 0L);
 
 			bool listOffline = false;
@@ -19,44 +15,48 @@
 			}
 
-            bool bViewAll = WebConnection.CanViewAllPlayers (permissionLevel);
+			bool bViewAll = WebConnection.CanViewAllPlayers (permissionLevel);
 
-            JSONArray playersJsResult = new JSONArray ();
+			JSONArray playersJsResult = new JSONArray ();
 
 			Players playersList = PersistentContainer.Instance.Players;
 
 			foreach (string sid in playersList.SteamIDs) {
-                if (admTools != null)
-                    if (admTools.IsBanned (sid))
-                        continue;
+				if (admTools != null) {
+					if (admTools.IsBanned (sid)) {
+						continue;
+					}
+				}
 
-                Player p = playersList [sid, false];
+				Player p = playersList [sid, false];
 
 				if (listOffline || p.IsOnline) {
-	                ulong player_steam_ID = 0L;
-	                if (!ulong.TryParse (sid, out player_steam_ID))
-	                    player_steam_ID = 0L;
+					ulong player_steam_ID = 0L;
+					if (!ulong.TryParse (sid, out player_steam_ID)) {
+						player_steam_ID = 0L;
+					}
 
-	                if ((player_steam_ID == user.SteamID) || bViewAll) {
-	                    JSONObject pos = new JSONObject ();
-	                    pos.Add("x", new JSONNumber (p.LastPosition.x));
-	                    pos.Add("y", new JSONNumber (p.LastPosition.y));
-	                    pos.Add("z", new JSONNumber (p.LastPosition.z));
+					if (player_steam_ID == user.SteamID || bViewAll) {
+						JSONObject pos = new JSONObject ();
+						pos.Add ("x", new JSONNumber (p.LastPosition.x));
+						pos.Add ("y", new JSONNumber (p.LastPosition.y));
+						pos.Add ("z", new JSONNumber (p.LastPosition.z));
 
-	                    JSONObject pJson = new JSONObject ();
-	                    pJson.Add("steamid", new JSONString (sid));
-	//					pJson.Add("entityid", new JSONNumber (p.EntityID));
-	//                    pJson.Add("ip", new JSONString (p.IP));
-	                    pJson.Add("name", new JSONString (p.Name));
-	                    pJson.Add("online", new JSONBoolean (p.IsOnline));
-	                    pJson.Add("position", pos);
+						JSONObject pJson = new JSONObject ();
+						pJson.Add ("steamid", new JSONString (sid));
 
-	//					pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime));
-	//					pJson.Add ("lastonline", new JSONString (p.LastOnline.ToString ("s")));
-	//					pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1));
+						//					pJson.Add("entityid", new JSONNumber (p.EntityID));
+						//                    pJson.Add("ip", new JSONString (p.IP));
+						pJson.Add ("name", new JSONString (p.Name));
+						pJson.Add ("online", new JSONBoolean (p.IsOnline));
+						pJson.Add ("position", pos);
+
+						//					pJson.Add ("totalplaytime", new JSONNumber (p.TotalPlayTime));
+						//					pJson.Add ("lastonline", new JSONString (p.LastOnline.ToString ("s")));
+						//					pJson.Add ("ping", new JSONNumber (p.IsOnline ? p.ClientInfo.ping : -1));
 
 						playersJsResult.Add (pJson);
-	                }
+					}
 				}
-            }
+			}
 
 			WriteJSON (resp, playersJsResult);
@@ -64,3 +64,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetPlayersOnline.cs	(revision 325)
@@ -1,15 +1,12 @@
+using System.Collections.Generic;
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class GetPlayersOnline : WebAPI
-	{
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
-			JSONArray players = new JSONArray();
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class GetPlayersOnline : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
+			JSONArray players = new JSONArray ();
 
 			World w = GameManager.Instance.World;
@@ -18,10 +15,10 @@
 				Player player = PersistentContainer.Instance.Players [ci.playerId, false];
 
-				JSONObject pos = new JSONObject();
-				pos.Add ("x", new JSONNumber ((int)current.Value.GetPosition ().x));
-				pos.Add ("y", new JSONNumber ((int)current.Value.GetPosition ().y));
-				pos.Add ("z", new JSONNumber ((int)current.Value.GetPosition ().z));
+				JSONObject pos = new JSONObject ();
+				pos.Add ("x", new JSONNumber ((int) current.Value.GetPosition ().x));
+				pos.Add ("y", new JSONNumber ((int) current.Value.GetPosition ().y));
+				pos.Add ("z", new JSONNumber ((int) current.Value.GetPosition ().z));
 
-				JSONObject p = new JSONObject();
+				JSONObject p = new JSONObject ();
 				p.Add ("steamid", new JSONString (ci.playerId));
 				p.Add ("entityid", new JSONNumber (ci.entityId));
@@ -46,10 +43,9 @@
 				p.Add ("ping", new JSONNumber (ci != null ? ci.ping : -1));
 
-				players.Add(p);
+				players.Add (p);
 			}
 
-			WriteJSON(resp, players);
+			WriteJSON (resp, players);
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetServerInfo.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetServerInfo.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetServerInfo.cs	(revision 325)
@@ -1,20 +1,16 @@
+using System;
+using System.Net;
 using AllocsFixes.JSON;
-using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class GetServerInfo : WebAPI
-	{
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class GetServerInfo : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			JSONObject serverInfo = new JSONObject ();
 
 			GameServerInfo gsi = Steam.Masterserver.Server.LocalGameInfo;
 
-			foreach (string stringGamePref in Enum.GetNames(typeof(GameInfoString))) {
-				string value = gsi.GetValue ( (GameInfoString)Enum.Parse (typeof(GameInfoString), stringGamePref) );
+			foreach (string stringGamePref in Enum.GetNames (typeof (GameInfoString))) {
+				string value = gsi.GetValue ((GameInfoString) Enum.Parse (typeof (GameInfoString), stringGamePref));
 
 				JSONObject singleStat = new JSONObject ();
@@ -25,6 +21,6 @@
 			}
 
-			foreach (string intGamePref in Enum.GetNames(typeof(GameInfoInt))) {
-				int value = gsi.GetValue ( (GameInfoInt)Enum.Parse (typeof(GameInfoInt), intGamePref) );
+			foreach (string intGamePref in Enum.GetNames (typeof (GameInfoInt))) {
+				int value = gsi.GetValue ((GameInfoInt) Enum.Parse (typeof (GameInfoInt), intGamePref));
 
 				JSONObject singleStat = new JSONObject ();
@@ -35,6 +31,6 @@
 			}
 
-			foreach (string boolGamePref in Enum.GetNames(typeof(GameInfoBool))) {
-				bool value = gsi.GetValue ( (GameInfoBool)Enum.Parse (typeof(GameInfoBool), boolGamePref) );
+			foreach (string boolGamePref in Enum.GetNames (typeof (GameInfoBool))) {
+				bool value = gsi.GetValue ((GameInfoBool) Enum.Parse (typeof (GameInfoBool), boolGamePref));
 
 				JSONObject singleStat = new JSONObject ();
@@ -46,7 +42,6 @@
 
 
-			WriteJSON(resp, serverInfo);
+			WriteJSON (resp, serverInfo);
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetStats.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetStats.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetStats.cs	(revision 325)
@@ -1,15 +1,10 @@
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.LiveData;
-using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public class GetStats : WebAPI
-	{
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class GetStats : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			JSONObject result = new JSONObject ();
 
@@ -32,3 +27,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/GetWebUIUpdates.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/GetWebUIUpdates.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/GetWebUIUpdates.cs	(revision 325)
@@ -1,15 +1,13 @@
+using System.Net;
 using AllocsFixes.JSON;
 using AllocsFixes.LiveData;
-using AllocsFixes.PersistentData;
-using System;
-using System.Collections.Generic;
-using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
 	public class GetWebUIUpdates : WebAPI {
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			int latestLine;
-			if (req.QueryString ["latestLine"] == null || !int.TryParse (req.QueryString ["latestLine"], out latestLine)) {
+			if (req.QueryString ["latestLine"] == null ||
+			    !int.TryParse (req.QueryString ["latestLine"], out latestLine)) {
 				latestLine = 0;
 			}
@@ -37,3 +35,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/API/Null.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/Null.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/Null.cs	(revision 325)
@@ -1,19 +1,14 @@
-﻿using AllocsFixes.JSON;
-using System;
-using System.Collections.Generic;
-using System.Net;
+﻿using System.Net;
 using System.Text;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-    public class Null : WebAPI
-    {
-        public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-        {
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public class Null : WebAPI {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			resp.ContentLength64 = 0;
 			resp.ContentType = "text/plain";
 			resp.ContentEncoding = Encoding.ASCII;
 			resp.OutputStream.Write (new byte[] { }, 0, 0);
-        }
-    }
+		}
+	}
 }
Index: binary-improvements/MapRendering/Web/API/WebAPI.cs
===================================================================
--- binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/API/WebAPI.cs	(revision 325)
@@ -1,12 +1,9 @@
-using System;
 using System.Net;
 using System.Text;
+using AllocsFixes.JSON;
 
-namespace AllocsFixes.NetConnections.Servers.Web.API
-{
-	public abstract class WebAPI
-	{
-		public static void WriteJSON (HttpListenerResponse resp, JSON.JSONNode root)
-		{
+namespace AllocsFixes.NetConnections.Servers.Web.API {
+	public abstract class WebAPI {
+		public static void WriteJSON (HttpListenerResponse resp, JSONNode root) {
 			StringBuilder sb = new StringBuilder ();
 			root.ToString (sb);
@@ -18,6 +15,5 @@
 		}
 
-		public static void WriteText (HttpListenerResponse _resp, string _text)
-		{
+		public static void WriteText (HttpListenerResponse _resp, string _text) {
 			byte[] buf = Encoding.UTF8.GetBytes (_text);
 			_resp.ContentLength64 = buf.Length;
@@ -27,5 +23,6 @@
 		}
 
-		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel);
+		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel);
 
 		public virtual int DefaultPermissionLevel () {
@@ -34,3 +31,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/ConnectionHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/ConnectionHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/ConnectionHandler.cs	(revision 325)
@@ -2,9 +2,8 @@
 using System.Collections.Generic;
 
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public class ConnectionHandler {
+		private readonly Dictionary<string, WebConnection> connections = new Dictionary<string, WebConnection> ();
 		private Web parent;
-		private Dictionary<string, WebConnection> connections = new Dictionary<string, WebConnection> ();
 
 		public ConnectionHandler (Web _parent) {
@@ -18,4 +17,5 @@
 
 			WebConnection con = connections [_sessionId];
+
 //			if (con.Age.TotalMinutes > parent.sessionTimeoutMinutes) {
 //				connections.Remove (_sessionId);
@@ -49,6 +49,4 @@
 			}
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/ApiHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/ApiHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/ApiHandler.cs	(revision 325)
@@ -1,15 +1,12 @@
-using AllocsFixes.NetConnections.Servers.Web.API;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Net;
 using System.Reflection;
-using System.Threading;
+using AllocsFixes.NetConnections.Servers.Web.API;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
 	public class ApiHandler : PathHandler {
-		private string staticPart;
-		private Dictionary<String, WebAPI> apis = new Dictionary<string, WebAPI> ();
+		private readonly Dictionary<string, WebAPI> apis = new Dictionary<string, WebAPI> ();
+		private readonly string staticPart;
 
 		public ApiHandler (string staticPart, string moduleName = null) : base (moduleName) {
@@ -17,8 +14,8 @@
 
 			foreach (Type t in Assembly.GetExecutingAssembly ().GetTypes ()) {
-				if (!t.IsAbstract && t.IsSubclassOf (typeof(WebAPI))) {
+				if (!t.IsAbstract && t.IsSubclassOf (typeof (WebAPI))) {
 					ConstructorInfo ctor = t.GetConstructor (new Type [0]);
 					if (ctor != null) {
-						WebAPI apiInstance = (WebAPI)ctor.Invoke (new object [0]);
+						WebAPI apiInstance = (WebAPI) ctor.Invoke (new object [0]);
 						addApi (t.Name.ToLower (), apiInstance);
 					}
@@ -26,14 +23,14 @@
 			}
 
-            // Add dummy types
-            Type dummy_t = typeof (API.Null);
-            ConstructorInfo dummy_ctor = dummy_t.GetConstructor (new Type [0]);
-            if (dummy_ctor != null) {
-                WebAPI dummy_apiInstance = (WebAPI)dummy_ctor.Invoke (new object[0]);
+			// Add dummy types
+			Type dummy_t = typeof (Null);
+			ConstructorInfo dummy_ctor = dummy_t.GetConstructor (new Type [0]);
+			if (dummy_ctor != null) {
+				WebAPI dummy_apiInstance = (WebAPI) dummy_ctor.Invoke (new object[0]);
 
-                // Permissions that don't map to a real API
-                addApi("viewallclaims", dummy_apiInstance);
-                addApi("viewallplayers", dummy_apiInstance);
-            }
+				// Permissions that don't map to a real API
+				addApi ("viewallclaims", dummy_apiInstance);
+				addApi ("viewallplayers", dummy_apiInstance);
+			}
 		}
 
@@ -43,32 +40,32 @@
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			string apiName = req.Url.AbsolutePath.Remove (0, staticPart.Length);
 			if (!AuthorizeForCommand (apiName, user, permissionLevel)) {
-				resp.StatusCode = (int)HttpStatusCode.Forbidden;
+				resp.StatusCode = (int) HttpStatusCode.Forbidden;
 				if (user != null) {
 					//Log.Out ("ApiHandler: user '{0}' not allowed to execute '{1}'", user.SteamID, apiName);
-				} else {
-					//Log.Out ("ApiHandler: unidentified user from '{0}' not allowed to execute '{1}'", req.RemoteEndPoint.Address, apiName);
 				}
+
 				return;
-			} else {
-				foreach (KeyValuePair<string, WebAPI> kvp in apis) {
-					if (apiName.StartsWith (kvp.Key)) {
-						try {
-							kvp.Value.HandleRequest (req, resp, user, permissionLevel);
-							return;
-						} catch (Exception e) {
-							Log.Error ("Error in ApiHandler.HandleRequest(): Handler {0} threw an exception:", kvp.Key);
-							Log.Exception (e);
-							resp.StatusCode = (int)HttpStatusCode.InternalServerError;
-							return;
-						}
+			}
+
+			foreach (KeyValuePair<string, WebAPI> kvp in apis) {
+				if (apiName.StartsWith (kvp.Key)) {
+					try {
+						kvp.Value.HandleRequest (req, resp, user, permissionLevel);
+						return;
+					} catch (Exception e) {
+						Log.Error ("Error in ApiHandler.HandleRequest(): Handler {0} threw an exception:", kvp.Key);
+						Log.Exception (e);
+						resp.StatusCode = (int) HttpStatusCode.InternalServerError;
+						return;
 					}
 				}
 			}
-	
+
 			Log.Out ("Error in ApiHandler.HandleRequest(): No handler found for API \"" + apiName + "\"");
-			resp.StatusCode = (int)HttpStatusCode.NotFound;
+			resp.StatusCode = (int) HttpStatusCode.NotFound;
 		}
 
@@ -76,7 +73,4 @@
 			return WebPermissions.Instance.ModuleAllowedWithLevel ("webapi." + apiName, permissionLevel);
 		}
-
 	}
-
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/ItemIconHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/ItemIconHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/ItemIconHandler.cs	(revision 325)
@@ -1,32 +1,33 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Net;
-using System.Threading;
+using UnityEngine;
+using Object = UnityEngine.Object;
 
-using UnityEngine;
-using System.IO;
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
+	public class ItemIconHandler : PathHandler {
+		private readonly Dictionary<string, byte[]> icons = new Dictionary<string, byte[]> ();
+		private readonly bool logMissingFiles;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
-	public class ItemIconHandler : PathHandler {
-		private static ItemIconHandler instance = null;
-		public static ItemIconHandler Instance {
-			get { return instance; }
+		private readonly string staticPart;
+		private bool loaded;
+
+		static ItemIconHandler () {
+			Instance = null;
 		}
 
-		private string staticPart;
-		private bool logMissingFiles;
-		private Dictionary<string, byte[]> icons = new Dictionary<string, byte[]> ();
-		private bool loaded = false;
-
-		public ItemIconHandler (string staticPart, bool logMissingFiles, string moduleName = null) : base(moduleName) {
+		public ItemIconHandler (string staticPart, bool logMissingFiles, string moduleName = null) : base (moduleName) {
 			this.staticPart = staticPart;
 			this.logMissingFiles = logMissingFiles;
-			ItemIconHandler.instance = this;
+			Instance = this;
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public static ItemIconHandler Instance { get; private set; }
+
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			if (!loaded) {
-				resp.StatusCode = (int)HttpStatusCode.InternalServerError;
+				resp.StatusCode = (int) HttpStatusCode.InternalServerError;
 				Log.Out ("Web:IconHandler: Icons not loaded");
 				return;
@@ -44,9 +45,8 @@
 				resp.OutputStream.Write (itemIconData, 0, itemIconData.Length);
 			} else {
-				resp.StatusCode = (int)HttpStatusCode.NotFound;
+				resp.StatusCode = (int) HttpStatusCode.NotFound;
 				if (logMissingFiles) {
 					Log.Out ("Web:IconHandler:FileNotFound: \"" + req.Url.AbsolutePath + "\" ");
 				}
-				return;
 			}
 		}
@@ -66,4 +66,5 @@
 					return false;
 				}
+
 				DynamicUIAtlas atlas = atlasObj.GetComponent<DynamicUIAtlas> ();
 				if (atlas == null) {
@@ -78,5 +79,6 @@
 				Texture2D atlasTex;
 
-				if (!DynamicUIAtlasTools.ReadPrebakedAtlasDescriptor (textureResourceName, out sprites, out elementWidth, out elementHeight)) {
+				if (!DynamicUIAtlasTools.ReadPrebakedAtlasDescriptor (textureResourceName, out sprites,
+					out elementWidth, out elementHeight)) {
 					SdtdConsole.Instance.Output ("Web:IconHandler: Could not read dynamic atlas descriptor");
 					return false;
@@ -98,4 +100,5 @@
 								tintedIcons.Add (name, new List<Color> ());
 							}
+
 							List<Color> list = tintedIcons [name];
 							list.Add (tintColor);
@@ -108,11 +111,13 @@
 					string name = data.name;
 					Texture2D tex = new Texture2D (data.width, data.height, TextureFormat.ARGB32, false);
-					tex.SetPixels (atlasTex.GetPixels (data.x, atlasTex.height - data.height - data.y, data.width, data.height));
+					tex.SetPixels (atlasTex.GetPixels (data.x, atlasTex.height - data.height - data.y, data.width,
+						data.height));
 
 					AddIcon (name, tex, tintedIcons);
 
-					UnityEngine.Object.Destroy (tex);
+					Object.Destroy (tex);
 				}
-				Resources.UnloadAsset(atlasTex);
+
+				Resources.UnloadAsset (atlasTex);
 
 				// Load icons from mods
@@ -131,5 +136,5 @@
 											}
 
-											UnityEngine.Object.Destroy (tex);
+											Object.Destroy (tex);
 										}
 									}
@@ -168,11 +173,9 @@
 						icons [tintedName] = tintedTex.EncodeToPNG ();
 
-						UnityEngine.Object.Destroy (tintedTex);
+						Object.Destroy (tintedTex);
 					}
 				}
 			}
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/PathHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/PathHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/PathHandler.cs	(revision 325)
@@ -1,29 +1,27 @@
-using System;
 using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
-	public abstract class PathHandler
-	{
-		private string moduleName = null;
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
+	public abstract class PathHandler {
+		private readonly string moduleName;
+
+		protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) {
+			moduleName = _moduleName;
+			WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel);
+		}
+
 		public string ModuleName {
 			get { return moduleName; }
 		}
 
-		protected PathHandler (string _moduleName, int _defaultPermissionLevel = 0) {
-			this.moduleName = _moduleName;
-			WebPermissions.Instance.AddKnownModule (_moduleName, _defaultPermissionLevel);
-		}
-
-		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel);
+		public abstract void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel);
 
 		public bool IsAuthorizedForHandler (WebConnection user, int permissionLevel) {
 			if (moduleName != null) {
 				return WebPermissions.Instance.ModuleAllowedWithLevel (moduleName, permissionLevel);
-			} else {
-				return true;
 			}
+
+			return true;
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/SessionHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/SessionHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/SessionHandler.cs	(revision 325)
@@ -1,20 +1,17 @@
-using System;
-using System.Collections.Generic;
 using System.IO;
 using System.Net;
 using System.Text;
-using System.Threading;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
 	public class SessionHandler : PathHandler {
-		private string staticPart;
-		private Web parent;
-		private string header = "";
-		private string footer = "";
+		private readonly string footer = "";
+		private readonly string header = "";
+		private readonly Web parent;
+		private readonly string staticPart;
 
-		public SessionHandler (string _staticPart, string _dataFolder, Web _parent, string moduleName = null) : base(moduleName) {
-			this.staticPart = _staticPart;
-			this.parent = _parent;
+		public SessionHandler (string _staticPart, string _dataFolder, Web _parent, string moduleName = null) :
+			base (moduleName) {
+			staticPart = _staticPart;
+			parent = _parent;
 
 			if (File.Exists (_dataFolder + "/sessionheader.tmpl")) {
@@ -27,5 +24,6 @@
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			string subpath = req.Url.AbsolutePath.Remove (0, staticPart.Length);
 
@@ -37,7 +35,8 @@
 					resp.Redirect ("/static/index.html");
 					return;
-				} else {
-					result.Append ("<h1>Login failed, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
 				}
+
+				result.Append (
+					"<h1>Login failed, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
 			} else if (subpath.StartsWith ("logout")) {
 				if (user != null) {
@@ -48,7 +47,8 @@
 					resp.Redirect ("/static/index.html");
 					return;
-				} else {
-					result.Append ("<h1>Not logged in, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
 				}
+
+				result.Append (
+					"<h1>Not logged in, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
 			} else if (subpath.StartsWith ("login")) {
 				string host = (Web.isSslRedirected (req) ? "https://" : "http://") + req.UserHostName;
@@ -57,5 +57,6 @@
 				return;
 			} else {
-				result.Append ("<h1>Unknown command, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
+				result.Append (
+					"<h1>Unknown command, <a href=\"/static/index.html\">click to return to main page</a>.</h1>");
 			}
 
@@ -68,7 +69,4 @@
 			resp.OutputStream.Write (buf, 0, buf.Length);
 		}
-
 	}
-
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/SimpleRedirectHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/SimpleRedirectHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/SimpleRedirectHandler.cs	(revision 325)
@@ -1,21 +1,16 @@
-using System;
 using System.Net;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
-	public class SimpleRedirectHandler : PathHandler
-	{
-		string target;
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
+	public class SimpleRedirectHandler : PathHandler {
+		private readonly string target;
 
-		public SimpleRedirectHandler (string target, string moduleName = null) : base(moduleName)
-		{
+		public SimpleRedirectHandler (string target, string moduleName = null) : base (moduleName) {
 			this.target = target;
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			resp.Redirect (target);
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/StaticHandler.cs	(revision 325)
@@ -1,27 +1,23 @@
-using System;
-using System.Collections.Generic;
 using System.IO;
 using System.Net;
-using System.Threading;
+using AllocsFixes.FileCache;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
-	public class StaticHandler : PathHandler
-	{
-		private string datapath;
-		private string staticPart;
-		private AllocsFixes.FileCache.AbstractCache cache;
-		private bool logMissingFiles;
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
+	public class StaticHandler : PathHandler {
+		private readonly AbstractCache cache;
+		private readonly string datapath;
+		private readonly bool logMissingFiles;
+		private readonly string staticPart;
 
-		public StaticHandler (string staticPart, string filePath, AllocsFixes.FileCache.AbstractCache cache, bool logMissingFiles, string moduleName = null) : base(moduleName)
-		{
+		public StaticHandler (string staticPart, string filePath, AbstractCache cache, bool logMissingFiles,
+			string moduleName = null) : base (moduleName) {
 			this.staticPart = staticPart;
-			this.datapath = filePath;
+			datapath = filePath;
 			this.cache = cache;
 			this.logMissingFiles = logMissingFiles;
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel)
-		{
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			string fn = req.Url.AbsolutePath.Remove (0, staticPart.Length);
 
@@ -33,11 +29,11 @@
 				resp.OutputStream.Write (content, 0, content.Length);
 			} else {
-				resp.StatusCode = (int)HttpStatusCode.NotFound;
-				if (logMissingFiles)
-					Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" + req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\"");
-				return;
+				resp.StatusCode = (int) HttpStatusCode.NotFound;
+				if (logMissingFiles) {
+					Log.Out ("Web:Static:FileNotFound: \"" + req.Url.AbsolutePath + "\" @ \"" + datapath + "/" +
+					         req.Url.AbsolutePath.Remove (0, staticPart.Length) + "\"");
+				}
 			}
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs
===================================================================
--- binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Handlers/UserStatusHandler.cs	(revision 325)
@@ -1,17 +1,13 @@
-using System;
-using System.Collections.Generic;
-using System.IO;
 using System.Net;
-using System.Threading;
-using System.Text;
 using AllocsFixes.JSON;
+using AllocsFixes.NetConnections.Servers.Web.API;
 
-namespace AllocsFixes.NetConnections.Servers.Web.Handlers
-{
+namespace AllocsFixes.NetConnections.Servers.Web.Handlers {
 	public class UserStatusHandler : PathHandler {
-		public UserStatusHandler (string moduleName = null) : base(moduleName) {
+		public UserStatusHandler (string moduleName = null) : base (moduleName) {
 		}
 
-		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user, int permissionLevel) {
+		public override void HandleRequest (HttpListenerRequest req, HttpListenerResponse resp, WebConnection user,
+			int permissionLevel) {
 			JSONObject result = new JSONObject ();
 
@@ -23,14 +19,13 @@
 				JSONObject permObj = new JSONObject ();
 				permObj.Add ("module", new JSONString (perm.module));
-				permObj.Add ("allowed", new JSONBoolean (WebPermissions.Instance.ModuleAllowedWithLevel (perm.module, permissionLevel)));
+				permObj.Add ("allowed",
+					new JSONBoolean (WebPermissions.Instance.ModuleAllowedWithLevel (perm.module, permissionLevel)));
 				perms.Add (permObj);
 			}
+
 			result.Add ("permissions", perms);
 
-			AllocsFixes.NetConnections.Servers.Web.API.WebAPI.WriteJSON (resp, result);
+			WebAPI.WriteJSON (resp, result);
 		}
-
 	}
-
 }
-
Index: binary-improvements/MapRendering/Web/LogBuffer.cs
===================================================================
--- binary-improvements/MapRendering/Web/LogBuffer.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/LogBuffer.cs	(revision 325)
@@ -2,12 +2,21 @@
 using System.Collections.Generic;
 using System.Text.RegularExpressions;
-
 using UnityEngine;
 
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public class LogBuffer {
 		private const int MAX_ENTRIES = 3000;
 		private static LogBuffer instance;
+
+		private static readonly Regex logMessageMatcher =
+			new Regex (@"^([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2}) ([0-9]+[,.][0-9]+) [A-Z]+ (.*)$");
+
+		private readonly List<LogEntry> logEntries = new List<LogEntry> ();
+
+		private int listOffset;
+
+		private LogBuffer () {
+			Logger.Main.LogCallbacks += LogCallback;
+		}
 
 		public static LogBuffer Instance {
@@ -16,11 +25,8 @@
 					instance = new LogBuffer ();
 				}
+
 				return instance;
 			}
 		}
-
-		private static Regex logMessageMatcher = new Regex (@"^([0-9]{4}-[0-9]{2}-[0-9]{2})T([0-9]{2}:[0-9]{2}:[0-9]{2}) ([0-9]+[,.][0-9]+) [A-Z]+ (.*)$");
-		private List<LogEntry> logEntries = new List<LogEntry> ();
-		private int listOffset = 0;
 
 		public int OldestLine {
@@ -55,10 +61,7 @@
 					}
 				}
+
 				return null;
 			}
-		}
-
-		private LogBuffer () {
-			Logger.Main.LogCallbacks += LogCallback;
 		}
 
@@ -123,11 +126,10 @@
 		public class LogEntry {
 			public string date;
+			public string message;
 			public string time;
-			public string uptime;
-			public string message;
 			public string trace;
 			public LogType type;
+			public string uptime;
 		}
 	}
 }
-
Index: binary-improvements/MapRendering/Web/MimeType.cs
===================================================================
--- binary-improvements/MapRendering/Web/MimeType.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/MimeType.cs	(revision 325)
@@ -2,573 +2,571 @@
 using System.Collections.Generic;
 
-namespace AllocsFixes.NetConnections.Servers.Web
-{
-	public class MimeType
-	{
-		private static IDictionary<string, string> _mappings = new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase) {
-        {".323", "text/h323"},
-        {".3g2", "video/3gpp2"},
-        {".3gp", "video/3gpp"},
-        {".3gp2", "video/3gpp2"},
-        {".3gpp", "video/3gpp"},
-        {".7z", "application/x-7z-compressed"},
-        {".aa", "audio/audible"},
-        {".AAC", "audio/aac"},
-        {".aaf", "application/octet-stream"},
-        {".aax", "audio/vnd.audible.aax"},
-        {".ac3", "audio/ac3"},
-        {".aca", "application/octet-stream"},
-        {".accda", "application/msaccess.addin"},
-        {".accdb", "application/msaccess"},
-        {".accdc", "application/msaccess.cab"},
-        {".accde", "application/msaccess"},
-        {".accdr", "application/msaccess.runtime"},
-        {".accdt", "application/msaccess"},
-        {".accdw", "application/msaccess.webapplication"},
-        {".accft", "application/msaccess.ftemplate"},
-        {".acx", "application/internet-property-stream"},
-        {".AddIn", "text/xml"},
-        {".ade", "application/msaccess"},
-        {".adobebridge", "application/x-bridge-url"},
-        {".adp", "application/msaccess"},
-        {".ADT", "audio/vnd.dlna.adts"},
-        {".ADTS", "audio/aac"},
-        {".afm", "application/octet-stream"},
-        {".ai", "application/postscript"},
-        {".aif", "audio/x-aiff"},
-        {".aifc", "audio/aiff"},
-        {".aiff", "audio/aiff"},
-        {".air", "application/vnd.adobe.air-application-installer-package+zip"},
-        {".amc", "application/x-mpeg"},
-        {".application", "application/x-ms-application"},
-        {".art", "image/x-jg"},
-        {".asa", "application/xml"},
-        {".asax", "application/xml"},
-        {".ascx", "application/xml"},
-        {".asd", "application/octet-stream"},
-        {".asf", "video/x-ms-asf"},
-        {".ashx", "application/xml"},
-        {".asi", "application/octet-stream"},
-        {".asm", "text/plain"},
-        {".asmx", "application/xml"},
-        {".aspx", "application/xml"},
-        {".asr", "video/x-ms-asf"},
-        {".asx", "video/x-ms-asf"},
-        {".atom", "application/atom+xml"},
-        {".au", "audio/basic"},
-        {".avi", "video/x-msvideo"},
-        {".axs", "application/olescript"},
-        {".bas", "text/plain"},
-        {".bcpio", "application/x-bcpio"},
-        {".bin", "application/octet-stream"},
-        {".bmp", "image/bmp"},
-        {".c", "text/plain"},
-        {".cab", "application/octet-stream"},
-        {".caf", "audio/x-caf"},
-        {".calx", "application/vnd.ms-office.calx"},
-        {".cat", "application/vnd.ms-pki.seccat"},
-        {".cc", "text/plain"},
-        {".cd", "text/plain"},
-        {".cdda", "audio/aiff"},
-        {".cdf", "application/x-cdf"},
-        {".cer", "application/x-x509-ca-cert"},
-        {".chm", "application/octet-stream"},
-        {".class", "application/x-java-applet"},
-        {".clp", "application/x-msclip"},
-        {".cmx", "image/x-cmx"},
-        {".cnf", "text/plain"},
-        {".cod", "image/cis-cod"},
-        {".config", "application/xml"},
-        {".contact", "text/x-ms-contact"},
-        {".coverage", "application/xml"},
-        {".cpio", "application/x-cpio"},
-        {".cpp", "text/plain"},
-        {".crd", "application/x-mscardfile"},
-        {".crl", "application/pkix-crl"},
-        {".crt", "application/x-x509-ca-cert"},
-        {".cs", "text/plain"},
-        {".csdproj", "text/plain"},
-        {".csh", "application/x-csh"},
-        {".csproj", "text/plain"},
-        {".css", "text/css"},
-        {".csv", "text/csv"},
-        {".cur", "application/octet-stream"},
-        {".cxx", "text/plain"},
-        {".dat", "application/octet-stream"},
-        {".datasource", "application/xml"},
-        {".dbproj", "text/plain"},
-        {".dcr", "application/x-director"},
-        {".def", "text/plain"},
-        {".deploy", "application/octet-stream"},
-        {".der", "application/x-x509-ca-cert"},
-        {".dgml", "application/xml"},
-        {".dib", "image/bmp"},
-        {".dif", "video/x-dv"},
-        {".dir", "application/x-director"},
-        {".disco", "text/xml"},
-        {".dll", "application/x-msdownload"},
-        {".dll.config", "text/xml"},
-        {".dlm", "text/dlm"},
-        {".doc", "application/msword"},
-        {".docm", "application/vnd.ms-word.document.macroEnabled.12"},
-        {".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
-        {".dot", "application/msword"},
-        {".dotm", "application/vnd.ms-word.template.macroEnabled.12"},
-        {".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
-        {".dsp", "application/octet-stream"},
-        {".dsw", "text/plain"},
-        {".dtd", "text/xml"},
-        {".dtsConfig", "text/xml"},
-        {".dv", "video/x-dv"},
-        {".dvi", "application/x-dvi"},
-        {".dwf", "drawing/x-dwf"},
-        {".dwp", "application/octet-stream"},
-        {".dxr", "application/x-director"},
-        {".eml", "message/rfc822"},
-        {".emz", "application/octet-stream"},
-        {".eot", "application/octet-stream"},
-        {".eps", "application/postscript"},
-        {".etl", "application/etl"},
-        {".etx", "text/x-setext"},
-        {".evy", "application/envoy"},
-        {".exe", "application/octet-stream"},
-        {".exe.config", "text/xml"},
-        {".fdf", "application/vnd.fdf"},
-        {".fif", "application/fractals"},
-        {".filters", "Application/xml"},
-        {".fla", "application/octet-stream"},
-        {".flr", "x-world/x-vrml"},
-        {".flv", "video/x-flv"},
-        {".fsscript", "application/fsharp-script"},
-        {".fsx", "application/fsharp-script"},
-        {".generictest", "application/xml"},
-        {".gif", "image/gif"},
-        {".group", "text/x-ms-group"},
-        {".gsm", "audio/x-gsm"},
-        {".gtar", "application/x-gtar"},
-        {".gz", "application/x-gzip"},
-        {".h", "text/plain"},
-        {".hdf", "application/x-hdf"},
-        {".hdml", "text/x-hdml"},
-        {".hhc", "application/x-oleobject"},
-        {".hhk", "application/octet-stream"},
-        {".hhp", "application/octet-stream"},
-        {".hlp", "application/winhlp"},
-        {".hpp", "text/plain"},
-        {".hqx", "application/mac-binhex40"},
-        {".hta", "application/hta"},
-        {".htc", "text/x-component"},
-        {".htm", "text/html"},
-        {".html", "text/html"},
-        {".htt", "text/webviewhtml"},
-        {".hxa", "application/xml"},
-        {".hxc", "application/xml"},
-        {".hxd", "application/octet-stream"},
-        {".hxe", "application/xml"},
-        {".hxf", "application/xml"},
-        {".hxh", "application/octet-stream"},
-        {".hxi", "application/octet-stream"},
-        {".hxk", "application/xml"},
-        {".hxq", "application/octet-stream"},
-        {".hxr", "application/octet-stream"},
-        {".hxs", "application/octet-stream"},
-        {".hxt", "text/html"},
-        {".hxv", "application/xml"},
-        {".hxw", "application/octet-stream"},
-        {".hxx", "text/plain"},
-        {".i", "text/plain"},
-        {".ico", "image/x-icon"},
-        {".ics", "application/octet-stream"},
-        {".idl", "text/plain"},
-        {".ief", "image/ief"},
-        {".iii", "application/x-iphone"},
-        {".inc", "text/plain"},
-        {".inf", "application/octet-stream"},
-        {".inl", "text/plain"},
-        {".ins", "application/x-internet-signup"},
-        {".ipa", "application/x-itunes-ipa"},
-        {".ipg", "application/x-itunes-ipg"},
-        {".ipproj", "text/plain"},
-        {".ipsw", "application/x-itunes-ipsw"},
-        {".iqy", "text/x-ms-iqy"},
-        {".isp", "application/x-internet-signup"},
-        {".ite", "application/x-itunes-ite"},
-        {".itlp", "application/x-itunes-itlp"},
-        {".itms", "application/x-itunes-itms"},
-        {".itpc", "application/x-itunes-itpc"},
-        {".IVF", "video/x-ivf"},
-        {".jar", "application/java-archive"},
-        {".java", "application/octet-stream"},
-        {".jck", "application/liquidmotion"},
-        {".jcz", "application/liquidmotion"},
-        {".jfif", "image/pjpeg"},
-        {".jnlp", "application/x-java-jnlp-file"},
-        {".jpb", "application/octet-stream"},
-        {".jpe", "image/jpeg"},
-        {".jpeg", "image/jpeg"},
-        {".jpg", "image/jpeg"},
-        {".js", "application/x-javascript"},
-		{".json", "application/json"},
-        {".jsx", "text/jscript"},
-        {".jsxbin", "text/plain"},
-        {".latex", "application/x-latex"},
-        {".library-ms", "application/windows-library+xml"},
-        {".lit", "application/x-ms-reader"},
-        {".loadtest", "application/xml"},
-        {".lpk", "application/octet-stream"},
-        {".lsf", "video/x-la-asf"},
-        {".lst", "text/plain"},
-        {".lsx", "video/x-la-asf"},
-        {".lzh", "application/octet-stream"},
-        {".m13", "application/x-msmediaview"},
-        {".m14", "application/x-msmediaview"},
-        {".m1v", "video/mpeg"},
-        {".m2t", "video/vnd.dlna.mpeg-tts"},
-        {".m2ts", "video/vnd.dlna.mpeg-tts"},
-        {".m2v", "video/mpeg"},
-        {".m3u", "audio/x-mpegurl"},
-        {".m3u8", "audio/x-mpegurl"},
-        {".m4a", "audio/m4a"},
-        {".m4b", "audio/m4b"},
-        {".m4p", "audio/m4p"},
-        {".m4r", "audio/x-m4r"},
-        {".m4v", "video/x-m4v"},
-        {".mac", "image/x-macpaint"},
-        {".mak", "text/plain"},
-        {".man", "application/x-troff-man"},
-        {".manifest", "application/x-ms-manifest"},
-        {".map", "text/plain"},
-        {".master", "application/xml"},
-        {".mda", "application/msaccess"},
-        {".mdb", "application/x-msaccess"},
-        {".mde", "application/msaccess"},
-        {".mdp", "application/octet-stream"},
-        {".me", "application/x-troff-me"},
-        {".mfp", "application/x-shockwave-flash"},
-        {".mht", "message/rfc822"},
-        {".mhtml", "message/rfc822"},
-        {".mid", "audio/mid"},
-        {".midi", "audio/mid"},
-        {".mix", "application/octet-stream"},
-        {".mk", "text/plain"},
-        {".mmf", "application/x-smaf"},
-        {".mno", "text/xml"},
-        {".mny", "application/x-msmoney"},
-        {".mod", "video/mpeg"},
-        {".mov", "video/quicktime"},
-        {".movie", "video/x-sgi-movie"},
-        {".mp2", "video/mpeg"},
-        {".mp2v", "video/mpeg"},
-        {".mp3", "audio/mpeg"},
-        {".mp4", "video/mp4"},
-        {".mp4v", "video/mp4"},
-        {".mpa", "video/mpeg"},
-        {".mpe", "video/mpeg"},
-        {".mpeg", "video/mpeg"},
-        {".mpf", "application/vnd.ms-mediapackage"},
-        {".mpg", "video/mpeg"},
-        {".mpp", "application/vnd.ms-project"},
-        {".mpv2", "video/mpeg"},
-        {".mqv", "video/quicktime"},
-        {".ms", "application/x-troff-ms"},
-        {".msi", "application/octet-stream"},
-        {".mso", "application/octet-stream"},
-        {".mts", "video/vnd.dlna.mpeg-tts"},
-        {".mtx", "application/xml"},
-        {".mvb", "application/x-msmediaview"},
-        {".mvc", "application/x-miva-compiled"},
-        {".mxp", "application/x-mmxp"},
-        {".nc", "application/x-netcdf"},
-        {".nsc", "video/x-ms-asf"},
-        {".nws", "message/rfc822"},
-        {".ocx", "application/octet-stream"},
-        {".oda", "application/oda"},
-        {".odc", "text/x-ms-odc"},
-        {".odh", "text/plain"},
-        {".odl", "text/plain"},
-        {".odp", "application/vnd.oasis.opendocument.presentation"},
-        {".ods", "application/oleobject"},
-        {".odt", "application/vnd.oasis.opendocument.text"},
-        {".one", "application/onenote"},
-        {".onea", "application/onenote"},
-        {".onepkg", "application/onenote"},
-        {".onetmp", "application/onenote"},
-        {".onetoc", "application/onenote"},
-        {".onetoc2", "application/onenote"},
-        {".orderedtest", "application/xml"},
-        {".osdx", "application/opensearchdescription+xml"},
-        {".p10", "application/pkcs10"},
-        {".p12", "application/x-pkcs12"},
-        {".p7b", "application/x-pkcs7-certificates"},
-        {".p7c", "application/pkcs7-mime"},
-        {".p7m", "application/pkcs7-mime"},
-        {".p7r", "application/x-pkcs7-certreqresp"},
-        {".p7s", "application/pkcs7-signature"},
-        {".pbm", "image/x-portable-bitmap"},
-        {".pcast", "application/x-podcast"},
-        {".pct", "image/pict"},
-        {".pcx", "application/octet-stream"},
-        {".pcz", "application/octet-stream"},
-        {".pdf", "application/pdf"},
-        {".pfb", "application/octet-stream"},
-        {".pfm", "application/octet-stream"},
-        {".pfx", "application/x-pkcs12"},
-        {".pgm", "image/x-portable-graymap"},
-        {".pic", "image/pict"},
-        {".pict", "image/pict"},
-        {".pkgdef", "text/plain"},
-        {".pkgundef", "text/plain"},
-        {".pko", "application/vnd.ms-pki.pko"},
-        {".pls", "audio/scpls"},
-        {".pma", "application/x-perfmon"},
-        {".pmc", "application/x-perfmon"},
-        {".pml", "application/x-perfmon"},
-        {".pmr", "application/x-perfmon"},
-        {".pmw", "application/x-perfmon"},
-        {".png", "image/png"},
-        {".pnm", "image/x-portable-anymap"},
-        {".pnt", "image/x-macpaint"},
-        {".pntg", "image/x-macpaint"},
-        {".pnz", "image/png"},
-        {".pot", "application/vnd.ms-powerpoint"},
-        {".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"},
-        {".potx", "application/vnd.openxmlformats-officedocument.presentationml.template"},
-        {".ppa", "application/vnd.ms-powerpoint"},
-        {".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"},
-        {".ppm", "image/x-portable-pixmap"},
-        {".pps", "application/vnd.ms-powerpoint"},
-        {".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"},
-        {".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
-        {".ppt", "application/vnd.ms-powerpoint"},
-        {".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"},
-        {".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
-        {".prf", "application/pics-rules"},
-        {".prm", "application/octet-stream"},
-        {".prx", "application/octet-stream"},
-        {".ps", "application/postscript"},
-        {".psc1", "application/PowerShell"},
-        {".psd", "application/octet-stream"},
-        {".psess", "application/xml"},
-        {".psm", "application/octet-stream"},
-        {".psp", "application/octet-stream"},
-        {".pub", "application/x-mspublisher"},
-        {".pwz", "application/vnd.ms-powerpoint"},
-        {".qht", "text/x-html-insertion"},
-        {".qhtm", "text/x-html-insertion"},
-        {".qt", "video/quicktime"},
-        {".qti", "image/x-quicktime"},
-        {".qtif", "image/x-quicktime"},
-        {".qtl", "application/x-quicktimeplayer"},
-        {".qxd", "application/octet-stream"},
-        {".ra", "audio/x-pn-realaudio"},
-        {".ram", "audio/x-pn-realaudio"},
-        {".rar", "application/octet-stream"},
-        {".ras", "image/x-cmu-raster"},
-        {".rat", "application/rat-file"},
-        {".rc", "text/plain"},
-        {".rc2", "text/plain"},
-        {".rct", "text/plain"},
-        {".rdlc", "application/xml"},
-        {".resx", "application/xml"},
-        {".rf", "image/vnd.rn-realflash"},
-        {".rgb", "image/x-rgb"},
-        {".rgs", "text/plain"},
-        {".rm", "application/vnd.rn-realmedia"},
-        {".rmi", "audio/mid"},
-        {".rmp", "application/vnd.rn-rn_music_package"},
-        {".roff", "application/x-troff"},
-        {".rpm", "audio/x-pn-realaudio-plugin"},
-        {".rqy", "text/x-ms-rqy"},
-        {".rtf", "application/rtf"},
-        {".rtx", "text/richtext"},
-        {".ruleset", "application/xml"},
-        {".s", "text/plain"},
-        {".safariextz", "application/x-safari-safariextz"},
-        {".scd", "application/x-msschedule"},
-        {".sct", "text/scriptlet"},
-        {".sd2", "audio/x-sd2"},
-        {".sdp", "application/sdp"},
-        {".sea", "application/octet-stream"},
-        {".searchConnector-ms", "application/windows-search-connector+xml"},
-        {".setpay", "application/set-payment-initiation"},
-        {".setreg", "application/set-registration-initiation"},
-        {".settings", "application/xml"},
-        {".sgimb", "application/x-sgimb"},
-        {".sgml", "text/sgml"},
-        {".sh", "application/x-sh"},
-        {".shar", "application/x-shar"},
-        {".shtml", "text/html"},
-        {".sit", "application/x-stuffit"},
-        {".sitemap", "application/xml"},
-        {".skin", "application/xml"},
-        {".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"},
-        {".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"},
-        {".slk", "application/vnd.ms-excel"},
-        {".sln", "text/plain"},
-        {".slupkg-ms", "application/x-ms-license"},
-        {".smd", "audio/x-smd"},
-        {".smi", "application/octet-stream"},
-        {".smx", "audio/x-smd"},
-        {".smz", "audio/x-smd"},
-        {".snd", "audio/basic"},
-        {".snippet", "application/xml"},
-        {".snp", "application/octet-stream"},
-        {".sol", "text/plain"},
-        {".sor", "text/plain"},
-        {".spc", "application/x-pkcs7-certificates"},
-        {".spl", "application/futuresplash"},
-        {".src", "application/x-wais-source"},
-        {".srf", "text/plain"},
-        {".SSISDeploymentManifest", "text/xml"},
-        {".ssm", "application/streamingmedia"},
-        {".sst", "application/vnd.ms-pki.certstore"},
-        {".stl", "application/vnd.ms-pki.stl"},
-        {".sv4cpio", "application/x-sv4cpio"},
-        {".sv4crc", "application/x-sv4crc"},
-        {".svc", "application/xml"},
-        {".swf", "application/x-shockwave-flash"},
-        {".t", "application/x-troff"},
-        {".tar", "application/x-tar"},
-        {".tcl", "application/x-tcl"},
-        {".testrunconfig", "application/xml"},
-        {".testsettings", "application/xml"},
-        {".tex", "application/x-tex"},
-        {".texi", "application/x-texinfo"},
-        {".texinfo", "application/x-texinfo"},
-        {".tgz", "application/x-compressed"},
-        {".thmx", "application/vnd.ms-officetheme"},
-        {".thn", "application/octet-stream"},
-        {".tif", "image/tiff"},
-        {".tiff", "image/tiff"},
-        {".tlh", "text/plain"},
-        {".tli", "text/plain"},
-        {".toc", "application/octet-stream"},
-        {".tr", "application/x-troff"},
-        {".trm", "application/x-msterminal"},
-        {".trx", "application/xml"},
-        {".ts", "video/vnd.dlna.mpeg-tts"},
-        {".tsv", "text/tab-separated-values"},
-        {".ttf", "application/octet-stream"},
-        {".tts", "video/vnd.dlna.mpeg-tts"},
-        {".txt", "text/plain"},
-        {".u32", "application/octet-stream"},
-        {".uls", "text/iuls"},
-        {".user", "text/plain"},
-        {".ustar", "application/x-ustar"},
-        {".vb", "text/plain"},
-        {".vbdproj", "text/plain"},
-        {".vbk", "video/mpeg"},
-        {".vbproj", "text/plain"},
-        {".vbs", "text/vbscript"},
-        {".vcf", "text/x-vcard"},
-        {".vcproj", "Application/xml"},
-        {".vcs", "text/plain"},
-        {".vcxproj", "Application/xml"},
-        {".vddproj", "text/plain"},
-        {".vdp", "text/plain"},
-        {".vdproj", "text/plain"},
-        {".vdx", "application/vnd.ms-visio.viewer"},
-        {".vml", "text/xml"},
-        {".vscontent", "application/xml"},
-        {".vsct", "text/xml"},
-        {".vsd", "application/vnd.visio"},
-        {".vsi", "application/ms-vsi"},
-        {".vsix", "application/vsix"},
-        {".vsixlangpack", "text/xml"},
-        {".vsixmanifest", "text/xml"},
-        {".vsmdi", "application/xml"},
-        {".vspscc", "text/plain"},
-        {".vss", "application/vnd.visio"},
-        {".vsscc", "text/plain"},
-        {".vssettings", "text/xml"},
-        {".vssscc", "text/plain"},
-        {".vst", "application/vnd.visio"},
-        {".vstemplate", "text/xml"},
-        {".vsto", "application/x-ms-vsto"},
-        {".vsw", "application/vnd.visio"},
-        {".vsx", "application/vnd.visio"},
-        {".vtx", "application/vnd.visio"},
-        {".wav", "audio/wav"},
-        {".wave", "audio/wav"},
-        {".wax", "audio/x-ms-wax"},
-        {".wbk", "application/msword"},
-        {".wbmp", "image/vnd.wap.wbmp"},
-        {".wcm", "application/vnd.ms-works"},
-        {".wdb", "application/vnd.ms-works"},
-        {".wdp", "image/vnd.ms-photo"},
-        {".webarchive", "application/x-safari-webarchive"},
-        {".webtest", "application/xml"},
-        {".wiq", "application/xml"},
-        {".wiz", "application/msword"},
-        {".wks", "application/vnd.ms-works"},
-        {".WLMP", "application/wlmoviemaker"},
-        {".wlpginstall", "application/x-wlpg-detect"},
-        {".wlpginstall3", "application/x-wlpg3-detect"},
-        {".wm", "video/x-ms-wm"},
-        {".wma", "audio/x-ms-wma"},
-        {".wmd", "application/x-ms-wmd"},
-        {".wmf", "application/x-msmetafile"},
-        {".wml", "text/vnd.wap.wml"},
-        {".wmlc", "application/vnd.wap.wmlc"},
-        {".wmls", "text/vnd.wap.wmlscript"},
-        {".wmlsc", "application/vnd.wap.wmlscriptc"},
-        {".wmp", "video/x-ms-wmp"},
-        {".wmv", "video/x-ms-wmv"},
-        {".wmx", "video/x-ms-wmx"},
-        {".wmz", "application/x-ms-wmz"},
-        {".wpl", "application/vnd.ms-wpl"},
-        {".wps", "application/vnd.ms-works"},
-        {".wri", "application/x-mswrite"},
-        {".wrl", "x-world/x-vrml"},
-        {".wrz", "x-world/x-vrml"},
-        {".wsc", "text/scriptlet"},
-        {".wsdl", "text/xml"},
-        {".wvx", "video/x-ms-wvx"},
-        {".x", "application/directx"},
-        {".xaf", "x-world/x-vrml"},
-        {".xaml", "application/xaml+xml"},
-        {".xap", "application/x-silverlight-app"},
-        {".xbap", "application/x-ms-xbap"},
-        {".xbm", "image/x-xbitmap"},
-        {".xdr", "text/plain"},
-        {".xht", "application/xhtml+xml"},
-        {".xhtml", "application/xhtml+xml"},
-        {".xla", "application/vnd.ms-excel"},
-        {".xlam", "application/vnd.ms-excel.addin.macroEnabled.12"},
-        {".xlc", "application/vnd.ms-excel"},
-        {".xld", "application/vnd.ms-excel"},
-        {".xlk", "application/vnd.ms-excel"},
-        {".xll", "application/vnd.ms-excel"},
-        {".xlm", "application/vnd.ms-excel"},
-        {".xls", "application/vnd.ms-excel"},
-        {".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"},
-        {".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"},
-        {".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
-        {".xlt", "application/vnd.ms-excel"},
-        {".xltm", "application/vnd.ms-excel.template.macroEnabled.12"},
-        {".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"},
-        {".xlw", "application/vnd.ms-excel"},
-        {".xml", "text/xml"},
-        {".xmta", "application/xml"},
-        {".xof", "x-world/x-vrml"},
-        {".XOML", "text/plain"},
-        {".xpm", "image/x-xpixmap"},
-        {".xps", "application/vnd.ms-xpsdocument"},
-        {".xrm-ms", "text/xml"},
-        {".xsc", "application/xml"},
-        {".xsd", "text/xml"},
-        {".xsf", "text/xml"},
-        {".xsl", "text/xml"},
-        {".xslt", "text/xml"},
-        {".xsn", "application/octet-stream"},
-        {".xss", "application/xml"},
-        {".xtp", "application/octet-stream"},
-        {".xwd", "image/x-xwindowdump"},
-        {".z", "application/x-compress"},
-        {".zip", "application/x-zip-compressed"},
-        };
+namespace AllocsFixes.NetConnections.Servers.Web {
+	public class MimeType {
+		private static readonly IDictionary<string, string> _mappings =
+			new Dictionary<string, string> (StringComparer.InvariantCultureIgnoreCase) {
+				{".323", "text/h323"},
+				{".3g2", "video/3gpp2"},
+				{".3gp", "video/3gpp"},
+				{".3gp2", "video/3gpp2"},
+				{".3gpp", "video/3gpp"},
+				{".7z", "application/x-7z-compressed"},
+				{".aa", "audio/audible"},
+				{".AAC", "audio/aac"},
+				{".aaf", "application/octet-stream"},
+				{".aax", "audio/vnd.audible.aax"},
+				{".ac3", "audio/ac3"},
+				{".aca", "application/octet-stream"},
+				{".accda", "application/msaccess.addin"},
+				{".accdb", "application/msaccess"},
+				{".accdc", "application/msaccess.cab"},
+				{".accde", "application/msaccess"},
+				{".accdr", "application/msaccess.runtime"},
+				{".accdt", "application/msaccess"},
+				{".accdw", "application/msaccess.webapplication"},
+				{".accft", "application/msaccess.ftemplate"},
+				{".acx", "application/internet-property-stream"},
+				{".AddIn", "text/xml"},
+				{".ade", "application/msaccess"},
+				{".adobebridge", "application/x-bridge-url"},
+				{".adp", "application/msaccess"},
+				{".ADT", "audio/vnd.dlna.adts"},
+				{".ADTS", "audio/aac"},
+				{".afm", "application/octet-stream"},
+				{".ai", "application/postscript"},
+				{".aif", "audio/x-aiff"},
+				{".aifc", "audio/aiff"},
+				{".aiff", "audio/aiff"},
+				{".air", "application/vnd.adobe.air-application-installer-package+zip"},
+				{".amc", "application/x-mpeg"},
+				{".application", "application/x-ms-application"},
+				{".art", "image/x-jg"},
+				{".asa", "application/xml"},
+				{".asax", "application/xml"},
+				{".ascx", "application/xml"},
+				{".asd", "application/octet-stream"},
+				{".asf", "video/x-ms-asf"},
+				{".ashx", "application/xml"},
+				{".asi", "application/octet-stream"},
+				{".asm", "text/plain"},
+				{".asmx", "application/xml"},
+				{".aspx", "application/xml"},
+				{".asr", "video/x-ms-asf"},
+				{".asx", "video/x-ms-asf"},
+				{".atom", "application/atom+xml"},
+				{".au", "audio/basic"},
+				{".avi", "video/x-msvideo"},
+				{".axs", "application/olescript"},
+				{".bas", "text/plain"},
+				{".bcpio", "application/x-bcpio"},
+				{".bin", "application/octet-stream"},
+				{".bmp", "image/bmp"},
+				{".c", "text/plain"},
+				{".cab", "application/octet-stream"},
+				{".caf", "audio/x-caf"},
+				{".calx", "application/vnd.ms-office.calx"},
+				{".cat", "application/vnd.ms-pki.seccat"},
+				{".cc", "text/plain"},
+				{".cd", "text/plain"},
+				{".cdda", "audio/aiff"},
+				{".cdf", "application/x-cdf"},
+				{".cer", "application/x-x509-ca-cert"},
+				{".chm", "application/octet-stream"},
+				{".class", "application/x-java-applet"},
+				{".clp", "application/x-msclip"},
+				{".cmx", "image/x-cmx"},
+				{".cnf", "text/plain"},
+				{".cod", "image/cis-cod"},
+				{".config", "application/xml"},
+				{".contact", "text/x-ms-contact"},
+				{".coverage", "application/xml"},
+				{".cpio", "application/x-cpio"},
+				{".cpp", "text/plain"},
+				{".crd", "application/x-mscardfile"},
+				{".crl", "application/pkix-crl"},
+				{".crt", "application/x-x509-ca-cert"},
+				{".cs", "text/plain"},
+				{".csdproj", "text/plain"},
+				{".csh", "application/x-csh"},
+				{".csproj", "text/plain"},
+				{".css", "text/css"},
+				{".csv", "text/csv"},
+				{".cur", "application/octet-stream"},
+				{".cxx", "text/plain"},
+				{".dat", "application/octet-stream"},
+				{".datasource", "application/xml"},
+				{".dbproj", "text/plain"},
+				{".dcr", "application/x-director"},
+				{".def", "text/plain"},
+				{".deploy", "application/octet-stream"},
+				{".der", "application/x-x509-ca-cert"},
+				{".dgml", "application/xml"},
+				{".dib", "image/bmp"},
+				{".dif", "video/x-dv"},
+				{".dir", "application/x-director"},
+				{".disco", "text/xml"},
+				{".dll", "application/x-msdownload"},
+				{".dll.config", "text/xml"},
+				{".dlm", "text/dlm"},
+				{".doc", "application/msword"},
+				{".docm", "application/vnd.ms-word.document.macroEnabled.12"},
+				{".docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
+				{".dot", "application/msword"},
+				{".dotm", "application/vnd.ms-word.template.macroEnabled.12"},
+				{".dotx", "application/vnd.openxmlformats-officedocument.wordprocessingml.template"},
+				{".dsp", "application/octet-stream"},
+				{".dsw", "text/plain"},
+				{".dtd", "text/xml"},
+				{".dtsConfig", "text/xml"},
+				{".dv", "video/x-dv"},
+				{".dvi", "application/x-dvi"},
+				{".dwf", "drawing/x-dwf"},
+				{".dwp", "application/octet-stream"},
+				{".dxr", "application/x-director"},
+				{".eml", "message/rfc822"},
+				{".emz", "application/octet-stream"},
+				{".eot", "application/octet-stream"},
+				{".eps", "application/postscript"},
+				{".etl", "application/etl"},
+				{".etx", "text/x-setext"},
+				{".evy", "application/envoy"},
+				{".exe", "application/octet-stream"},
+				{".exe.config", "text/xml"},
+				{".fdf", "application/vnd.fdf"},
+				{".fif", "application/fractals"},
+				{".filters", "Application/xml"},
+				{".fla", "application/octet-stream"},
+				{".flr", "x-world/x-vrml"},
+				{".flv", "video/x-flv"},
+				{".fsscript", "application/fsharp-script"},
+				{".fsx", "application/fsharp-script"},
+				{".generictest", "application/xml"},
+				{".gif", "image/gif"},
+				{".group", "text/x-ms-group"},
+				{".gsm", "audio/x-gsm"},
+				{".gtar", "application/x-gtar"},
+				{".gz", "application/x-gzip"},
+				{".h", "text/plain"},
+				{".hdf", "application/x-hdf"},
+				{".hdml", "text/x-hdml"},
+				{".hhc", "application/x-oleobject"},
+				{".hhk", "application/octet-stream"},
+				{".hhp", "application/octet-stream"},
+				{".hlp", "application/winhlp"},
+				{".hpp", "text/plain"},
+				{".hqx", "application/mac-binhex40"},
+				{".hta", "application/hta"},
+				{".htc", "text/x-component"},
+				{".htm", "text/html"},
+				{".html", "text/html"},
+				{".htt", "text/webviewhtml"},
+				{".hxa", "application/xml"},
+				{".hxc", "application/xml"},
+				{".hxd", "application/octet-stream"},
+				{".hxe", "application/xml"},
+				{".hxf", "application/xml"},
+				{".hxh", "application/octet-stream"},
+				{".hxi", "application/octet-stream"},
+				{".hxk", "application/xml"},
+				{".hxq", "application/octet-stream"},
+				{".hxr", "application/octet-stream"},
+				{".hxs", "application/octet-stream"},
+				{".hxt", "text/html"},
+				{".hxv", "application/xml"},
+				{".hxw", "application/octet-stream"},
+				{".hxx", "text/plain"},
+				{".i", "text/plain"},
+				{".ico", "image/x-icon"},
+				{".ics", "application/octet-stream"},
+				{".idl", "text/plain"},
+				{".ief", "image/ief"},
+				{".iii", "application/x-iphone"},
+				{".inc", "text/plain"},
+				{".inf", "application/octet-stream"},
+				{".inl", "text/plain"},
+				{".ins", "application/x-internet-signup"},
+				{".ipa", "application/x-itunes-ipa"},
+				{".ipg", "application/x-itunes-ipg"},
+				{".ipproj", "text/plain"},
+				{".ipsw", "application/x-itunes-ipsw"},
+				{".iqy", "text/x-ms-iqy"},
+				{".isp", "application/x-internet-signup"},
+				{".ite", "application/x-itunes-ite"},
+				{".itlp", "application/x-itunes-itlp"},
+				{".itms", "application/x-itunes-itms"},
+				{".itpc", "application/x-itunes-itpc"},
+				{".IVF", "video/x-ivf"},
+				{".jar", "application/java-archive"},
+				{".java", "application/octet-stream"},
+				{".jck", "application/liquidmotion"},
+				{".jcz", "application/liquidmotion"},
+				{".jfif", "image/pjpeg"},
+				{".jnlp", "application/x-java-jnlp-file"},
+				{".jpb", "application/octet-stream"},
+				{".jpe", "image/jpeg"},
+				{".jpeg", "image/jpeg"},
+				{".jpg", "image/jpeg"},
+				{".js", "application/x-javascript"},
+				{".json", "application/json"},
+				{".jsx", "text/jscript"},
+				{".jsxbin", "text/plain"},
+				{".latex", "application/x-latex"},
+				{".library-ms", "application/windows-library+xml"},
+				{".lit", "application/x-ms-reader"},
+				{".loadtest", "application/xml"},
+				{".lpk", "application/octet-stream"},
+				{".lsf", "video/x-la-asf"},
+				{".lst", "text/plain"},
+				{".lsx", "video/x-la-asf"},
+				{".lzh", "application/octet-stream"},
+				{".m13", "application/x-msmediaview"},
+				{".m14", "application/x-msmediaview"},
+				{".m1v", "video/mpeg"},
+				{".m2t", "video/vnd.dlna.mpeg-tts"},
+				{".m2ts", "video/vnd.dlna.mpeg-tts"},
+				{".m2v", "video/mpeg"},
+				{".m3u", "audio/x-mpegurl"},
+				{".m3u8", "audio/x-mpegurl"},
+				{".m4a", "audio/m4a"},
+				{".m4b", "audio/m4b"},
+				{".m4p", "audio/m4p"},
+				{".m4r", "audio/x-m4r"},
+				{".m4v", "video/x-m4v"},
+				{".mac", "image/x-macpaint"},
+				{".mak", "text/plain"},
+				{".man", "application/x-troff-man"},
+				{".manifest", "application/x-ms-manifest"},
+				{".map", "text/plain"},
+				{".master", "application/xml"},
+				{".mda", "application/msaccess"},
+				{".mdb", "application/x-msaccess"},
+				{".mde", "application/msaccess"},
+				{".mdp", "application/octet-stream"},
+				{".me", "application/x-troff-me"},
+				{".mfp", "application/x-shockwave-flash"},
+				{".mht", "message/rfc822"},
+				{".mhtml", "message/rfc822"},
+				{".mid", "audio/mid"},
+				{".midi", "audio/mid"},
+				{".mix", "application/octet-stream"},
+				{".mk", "text/plain"},
+				{".mmf", "application/x-smaf"},
+				{".mno", "text/xml"},
+				{".mny", "application/x-msmoney"},
+				{".mod", "video/mpeg"},
+				{".mov", "video/quicktime"},
+				{".movie", "video/x-sgi-movie"},
+				{".mp2", "video/mpeg"},
+				{".mp2v", "video/mpeg"},
+				{".mp3", "audio/mpeg"},
+				{".mp4", "video/mp4"},
+				{".mp4v", "video/mp4"},
+				{".mpa", "video/mpeg"},
+				{".mpe", "video/mpeg"},
+				{".mpeg", "video/mpeg"},
+				{".mpf", "application/vnd.ms-mediapackage"},
+				{".mpg", "video/mpeg"},
+				{".mpp", "application/vnd.ms-project"},
+				{".mpv2", "video/mpeg"},
+				{".mqv", "video/quicktime"},
+				{".ms", "application/x-troff-ms"},
+				{".msi", "application/octet-stream"},
+				{".mso", "application/octet-stream"},
+				{".mts", "video/vnd.dlna.mpeg-tts"},
+				{".mtx", "application/xml"},
+				{".mvb", "application/x-msmediaview"},
+				{".mvc", "application/x-miva-compiled"},
+				{".mxp", "application/x-mmxp"},
+				{".nc", "application/x-netcdf"},
+				{".nsc", "video/x-ms-asf"},
+				{".nws", "message/rfc822"},
+				{".ocx", "application/octet-stream"},
+				{".oda", "application/oda"},
+				{".odc", "text/x-ms-odc"},
+				{".odh", "text/plain"},
+				{".odl", "text/plain"},
+				{".odp", "application/vnd.oasis.opendocument.presentation"},
+				{".ods", "application/oleobject"},
+				{".odt", "application/vnd.oasis.opendocument.text"},
+				{".one", "application/onenote"},
+				{".onea", "application/onenote"},
+				{".onepkg", "application/onenote"},
+				{".onetmp", "application/onenote"},
+				{".onetoc", "application/onenote"},
+				{".onetoc2", "application/onenote"},
+				{".orderedtest", "application/xml"},
+				{".osdx", "application/opensearchdescription+xml"},
+				{".p10", "application/pkcs10"},
+				{".p12", "application/x-pkcs12"},
+				{".p7b", "application/x-pkcs7-certificates"},
+				{".p7c", "application/pkcs7-mime"},
+				{".p7m", "application/pkcs7-mime"},
+				{".p7r", "application/x-pkcs7-certreqresp"},
+				{".p7s", "application/pkcs7-signature"},
+				{".pbm", "image/x-portable-bitmap"},
+				{".pcast", "application/x-podcast"},
+				{".pct", "image/pict"},
+				{".pcx", "application/octet-stream"},
+				{".pcz", "application/octet-stream"},
+				{".pdf", "application/pdf"},
+				{".pfb", "application/octet-stream"},
+				{".pfm", "application/octet-stream"},
+				{".pfx", "application/x-pkcs12"},
+				{".pgm", "image/x-portable-graymap"},
+				{".pic", "image/pict"},
+				{".pict", "image/pict"},
+				{".pkgdef", "text/plain"},
+				{".pkgundef", "text/plain"},
+				{".pko", "application/vnd.ms-pki.pko"},
+				{".pls", "audio/scpls"},
+				{".pma", "application/x-perfmon"},
+				{".pmc", "application/x-perfmon"},
+				{".pml", "application/x-perfmon"},
+				{".pmr", "application/x-perfmon"},
+				{".pmw", "application/x-perfmon"},
+				{".png", "image/png"},
+				{".pnm", "image/x-portable-anymap"},
+				{".pnt", "image/x-macpaint"},
+				{".pntg", "image/x-macpaint"},
+				{".pnz", "image/png"},
+				{".pot", "application/vnd.ms-powerpoint"},
+				{".potm", "application/vnd.ms-powerpoint.template.macroEnabled.12"},
+				{".potx", "application/vnd.openxmlformats-officedocument.presentationml.template"},
+				{".ppa", "application/vnd.ms-powerpoint"},
+				{".ppam", "application/vnd.ms-powerpoint.addin.macroEnabled.12"},
+				{".ppm", "image/x-portable-pixmap"},
+				{".pps", "application/vnd.ms-powerpoint"},
+				{".ppsm", "application/vnd.ms-powerpoint.slideshow.macroEnabled.12"},
+				{".ppsx", "application/vnd.openxmlformats-officedocument.presentationml.slideshow"},
+				{".ppt", "application/vnd.ms-powerpoint"},
+				{".pptm", "application/vnd.ms-powerpoint.presentation.macroEnabled.12"},
+				{".pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
+				{".prf", "application/pics-rules"},
+				{".prm", "application/octet-stream"},
+				{".prx", "application/octet-stream"},
+				{".ps", "application/postscript"},
+				{".psc1", "application/PowerShell"},
+				{".psd", "application/octet-stream"},
+				{".psess", "application/xml"},
+				{".psm", "application/octet-stream"},
+				{".psp", "application/octet-stream"},
+				{".pub", "application/x-mspublisher"},
+				{".pwz", "application/vnd.ms-powerpoint"},
+				{".qht", "text/x-html-insertion"},
+				{".qhtm", "text/x-html-insertion"},
+				{".qt", "video/quicktime"},
+				{".qti", "image/x-quicktime"},
+				{".qtif", "image/x-quicktime"},
+				{".qtl", "application/x-quicktimeplayer"},
+				{".qxd", "application/octet-stream"},
+				{".ra", "audio/x-pn-realaudio"},
+				{".ram", "audio/x-pn-realaudio"},
+				{".rar", "application/octet-stream"},
+				{".ras", "image/x-cmu-raster"},
+				{".rat", "application/rat-file"},
+				{".rc", "text/plain"},
+				{".rc2", "text/plain"},
+				{".rct", "text/plain"},
+				{".rdlc", "application/xml"},
+				{".resx", "application/xml"},
+				{".rf", "image/vnd.rn-realflash"},
+				{".rgb", "image/x-rgb"},
+				{".rgs", "text/plain"},
+				{".rm", "application/vnd.rn-realmedia"},
+				{".rmi", "audio/mid"},
+				{".rmp", "application/vnd.rn-rn_music_package"},
+				{".roff", "application/x-troff"},
+				{".rpm", "audio/x-pn-realaudio-plugin"},
+				{".rqy", "text/x-ms-rqy"},
+				{".rtf", "application/rtf"},
+				{".rtx", "text/richtext"},
+				{".ruleset", "application/xml"},
+				{".s", "text/plain"},
+				{".safariextz", "application/x-safari-safariextz"},
+				{".scd", "application/x-msschedule"},
+				{".sct", "text/scriptlet"},
+				{".sd2", "audio/x-sd2"},
+				{".sdp", "application/sdp"},
+				{".sea", "application/octet-stream"},
+				{".searchConnector-ms", "application/windows-search-connector+xml"},
+				{".setpay", "application/set-payment-initiation"},
+				{".setreg", "application/set-registration-initiation"},
+				{".settings", "application/xml"},
+				{".sgimb", "application/x-sgimb"},
+				{".sgml", "text/sgml"},
+				{".sh", "application/x-sh"},
+				{".shar", "application/x-shar"},
+				{".shtml", "text/html"},
+				{".sit", "application/x-stuffit"},
+				{".sitemap", "application/xml"},
+				{".skin", "application/xml"},
+				{".sldm", "application/vnd.ms-powerpoint.slide.macroEnabled.12"},
+				{".sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"},
+				{".slk", "application/vnd.ms-excel"},
+				{".sln", "text/plain"},
+				{".slupkg-ms", "application/x-ms-license"},
+				{".smd", "audio/x-smd"},
+				{".smi", "application/octet-stream"},
+				{".smx", "audio/x-smd"},
+				{".smz", "audio/x-smd"},
+				{".snd", "audio/basic"},
+				{".snippet", "application/xml"},
+				{".snp", "application/octet-stream"},
+				{".sol", "text/plain"},
+				{".sor", "text/plain"},
+				{".spc", "application/x-pkcs7-certificates"},
+				{".spl", "application/futuresplash"},
+				{".src", "application/x-wais-source"},
+				{".srf", "text/plain"},
+				{".SSISDeploymentManifest", "text/xml"},
+				{".ssm", "application/streamingmedia"},
+				{".sst", "application/vnd.ms-pki.certstore"},
+				{".stl", "application/vnd.ms-pki.stl"},
+				{".sv4cpio", "application/x-sv4cpio"},
+				{".sv4crc", "application/x-sv4crc"},
+				{".svc", "application/xml"},
+				{".swf", "application/x-shockwave-flash"},
+				{".t", "application/x-troff"},
+				{".tar", "application/x-tar"},
+				{".tcl", "application/x-tcl"},
+				{".testrunconfig", "application/xml"},
+				{".testsettings", "application/xml"},
+				{".tex", "application/x-tex"},
+				{".texi", "application/x-texinfo"},
+				{".texinfo", "application/x-texinfo"},
+				{".tgz", "application/x-compressed"},
+				{".thmx", "application/vnd.ms-officetheme"},
+				{".thn", "application/octet-stream"},
+				{".tif", "image/tiff"},
+				{".tiff", "image/tiff"},
+				{".tlh", "text/plain"},
+				{".tli", "text/plain"},
+				{".toc", "application/octet-stream"},
+				{".tr", "application/x-troff"},
+				{".trm", "application/x-msterminal"},
+				{".trx", "application/xml"},
+				{".ts", "video/vnd.dlna.mpeg-tts"},
+				{".tsv", "text/tab-separated-values"},
+				{".ttf", "application/octet-stream"},
+				{".tts", "video/vnd.dlna.mpeg-tts"},
+				{".txt", "text/plain"},
+				{".u32", "application/octet-stream"},
+				{".uls", "text/iuls"},
+				{".user", "text/plain"},
+				{".ustar", "application/x-ustar"},
+				{".vb", "text/plain"},
+				{".vbdproj", "text/plain"},
+				{".vbk", "video/mpeg"},
+				{".vbproj", "text/plain"},
+				{".vbs", "text/vbscript"},
+				{".vcf", "text/x-vcard"},
+				{".vcproj", "Application/xml"},
+				{".vcs", "text/plain"},
+				{".vcxproj", "Application/xml"},
+				{".vddproj", "text/plain"},
+				{".vdp", "text/plain"},
+				{".vdproj", "text/plain"},
+				{".vdx", "application/vnd.ms-visio.viewer"},
+				{".vml", "text/xml"},
+				{".vscontent", "application/xml"},
+				{".vsct", "text/xml"},
+				{".vsd", "application/vnd.visio"},
+				{".vsi", "application/ms-vsi"},
+				{".vsix", "application/vsix"},
+				{".vsixlangpack", "text/xml"},
+				{".vsixmanifest", "text/xml"},
+				{".vsmdi", "application/xml"},
+				{".vspscc", "text/plain"},
+				{".vss", "application/vnd.visio"},
+				{".vsscc", "text/plain"},
+				{".vssettings", "text/xml"},
+				{".vssscc", "text/plain"},
+				{".vst", "application/vnd.visio"},
+				{".vstemplate", "text/xml"},
+				{".vsto", "application/x-ms-vsto"},
+				{".vsw", "application/vnd.visio"},
+				{".vsx", "application/vnd.visio"},
+				{".vtx", "application/vnd.visio"},
+				{".wav", "audio/wav"},
+				{".wave", "audio/wav"},
+				{".wax", "audio/x-ms-wax"},
+				{".wbk", "application/msword"},
+				{".wbmp", "image/vnd.wap.wbmp"},
+				{".wcm", "application/vnd.ms-works"},
+				{".wdb", "application/vnd.ms-works"},
+				{".wdp", "image/vnd.ms-photo"},
+				{".webarchive", "application/x-safari-webarchive"},
+				{".webtest", "application/xml"},
+				{".wiq", "application/xml"},
+				{".wiz", "application/msword"},
+				{".wks", "application/vnd.ms-works"},
+				{".WLMP", "application/wlmoviemaker"},
+				{".wlpginstall", "application/x-wlpg-detect"},
+				{".wlpginstall3", "application/x-wlpg3-detect"},
+				{".wm", "video/x-ms-wm"},
+				{".wma", "audio/x-ms-wma"},
+				{".wmd", "application/x-ms-wmd"},
+				{".wmf", "application/x-msmetafile"},
+				{".wml", "text/vnd.wap.wml"},
+				{".wmlc", "application/vnd.wap.wmlc"},
+				{".wmls", "text/vnd.wap.wmlscript"},
+				{".wmlsc", "application/vnd.wap.wmlscriptc"},
+				{".wmp", "video/x-ms-wmp"},
+				{".wmv", "video/x-ms-wmv"},
+				{".wmx", "video/x-ms-wmx"},
+				{".wmz", "application/x-ms-wmz"},
+				{".wpl", "application/vnd.ms-wpl"},
+				{".wps", "application/vnd.ms-works"},
+				{".wri", "application/x-mswrite"},
+				{".wrl", "x-world/x-vrml"},
+				{".wrz", "x-world/x-vrml"},
+				{".wsc", "text/scriptlet"},
+				{".wsdl", "text/xml"},
+				{".wvx", "video/x-ms-wvx"},
+				{".x", "application/directx"},
+				{".xaf", "x-world/x-vrml"},
+				{".xaml", "application/xaml+xml"},
+				{".xap", "application/x-silverlight-app"},
+				{".xbap", "application/x-ms-xbap"},
+				{".xbm", "image/x-xbitmap"},
+				{".xdr", "text/plain"},
+				{".xht", "application/xhtml+xml"},
+				{".xhtml", "application/xhtml+xml"},
+				{".xla", "application/vnd.ms-excel"},
+				{".xlam", "application/vnd.ms-excel.addin.macroEnabled.12"},
+				{".xlc", "application/vnd.ms-excel"},
+				{".xld", "application/vnd.ms-excel"},
+				{".xlk", "application/vnd.ms-excel"},
+				{".xll", "application/vnd.ms-excel"},
+				{".xlm", "application/vnd.ms-excel"},
+				{".xls", "application/vnd.ms-excel"},
+				{".xlsb", "application/vnd.ms-excel.sheet.binary.macroEnabled.12"},
+				{".xlsm", "application/vnd.ms-excel.sheet.macroEnabled.12"},
+				{".xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
+				{".xlt", "application/vnd.ms-excel"},
+				{".xltm", "application/vnd.ms-excel.template.macroEnabled.12"},
+				{".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"},
+				{".xlw", "application/vnd.ms-excel"},
+				{".xml", "text/xml"},
+				{".xmta", "application/xml"},
+				{".xof", "x-world/x-vrml"},
+				{".XOML", "text/plain"},
+				{".xpm", "image/x-xpixmap"},
+				{".xps", "application/vnd.ms-xpsdocument"},
+				{".xrm-ms", "text/xml"},
+				{".xsc", "application/xml"},
+				{".xsd", "text/xml"},
+				{".xsf", "text/xml"},
+				{".xsl", "text/xml"},
+				{".xslt", "text/xml"},
+				{".xsn", "application/octet-stream"},
+				{".xss", "application/xml"},
+				{".xtp", "application/octet-stream"},
+				{".xwd", "image/x-xwindowdump"},
+				{".z", "application/x-compress"},
+				{".zip", "application/x-zip-compressed"}
+			};
 
-		public static string GetMimeType (string extension)
-		{
+		public static string GetMimeType (string extension) {
 			if (extension == null) {
 				throw new ArgumentNullException ("extension");
@@ -585,3 +583,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/OpenID.cs
===================================================================
--- binary-improvements/MapRendering/Web/OpenID.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/OpenID.cs	(revision 325)
@@ -5,24 +5,30 @@
 using System.Net;
 using System.Net.Security;
+using System.Reflection;
+using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Security.Cryptography.X509Certificates;
-using System.Reflection;
-
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public static class OpenID {
 		private const string STEAM_LOGIN = "https://steamcommunity.com/openid/login";
-		private static Regex steamIdUrlMatcher = new Regex (@"^https?:\/\/steamcommunity\.com\/openid\/id\/([0-9]{17,18})");
-
-		private static readonly X509Certificate2 caCert = new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/steam-rootca.cer");
-		private static readonly X509Certificate2 caIntermediateCert = new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/steam-intermediate.cer");
+
+		private static readonly Regex steamIdUrlMatcher =
+			new Regex (@"^https?:\/\/steamcommunity\.com\/openid\/id\/([0-9]{17,18})");
+
+		private static readonly X509Certificate2 caCert =
+			new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) +
+			                      "/steam-rootca.cer");
+
+		private static readonly X509Certificate2 caIntermediateCert =
+			new X509Certificate2 (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) +
+			                      "/steam-intermediate.cer");
 
 		private static readonly bool verboseSsl = false;
-		public static bool debugOpenId = false;
+		public static bool debugOpenId;
 
 		static OpenID () {
-			for (int i = 0; i < System.Environment.GetCommandLineArgs ().Length; i++) {
-				if (System.Environment.GetCommandLineArgs () [i].EqualsCaseInsensitive ("-debugopenid")) {
+			for (int i = 0; i < Environment.GetCommandLineArgs ().Length; i++) {
+				if (Environment.GetCommandLineArgs () [i].EqualsCaseInsensitive ("-debugopenid")) {
 					debugOpenId = true;
 				}
@@ -34,4 +40,5 @@
 						Log.Out ("Steam certificate: No error (1)");
 					}
+
 					return true;
 				}
@@ -49,4 +56,5 @@
 						Log.Out ("Steam certificate: No error (2)");
 					}
+
 					return true;
 				}
@@ -58,4 +66,5 @@
 						Log.Out ("Steam certificate: No error (3)");
 					}
+
 					return true;
 				}
@@ -66,4 +75,5 @@
 						Log.Out ("Validating cert: " + chainEl.Certificate.Subject);
 					}
+
 					// Iterate all status flags of the current cert
 					foreach (X509ChainStatus chainStatus in chainEl.ChainElementStatus) {
@@ -71,14 +81,18 @@
 							Log.Out ("   Status: " + chainStatus.Status);
 						}
+
 						if (chainStatus.Status == X509ChainStatusFlags.NoError) {
 							// This status is not an error, skip
 							continue;
 						}
+
 						if (chainStatus.Status == X509ChainStatusFlags.UntrustedRoot && chainEl.Certificate == caCert) {
 							// This status is about the cert being an untrusted root certificate but the certificate is one of those we added, ignore
 							continue;
 						}
+
 						// This status is an error, print information
-						Log.Warning ("Steam certificate error: " + chainEl.Certificate.Subject + " ### Error: " + chainStatus.Status);
+						Log.Warning ("Steam certificate error: " + chainEl.Certificate.Subject + " ### Error: " +
+						             chainStatus.Status);
 						privateChain.Reset ();
 						return false;
@@ -87,5 +101,6 @@
 
 				foreach (X509ChainStatus chainStatus in privateChain.ChainStatus) {
-					if (chainStatus.Status != X509ChainStatusFlags.NoError && chainStatus.Status != X509ChainStatusFlags.UntrustedRoot) {
+					if (chainStatus.Status != X509ChainStatusFlags.NoError &&
+					    chainStatus.Status != X509ChainStatusFlags.UntrustedRoot) {
 						Log.Warning ("Steam certificate error: " + chainStatus.Status);
 						privateChain.Reset ();
@@ -99,7 +114,7 @@
 					Log.Out ("Steam certificate: No error (4)");
 				}
+
 				return true;
 			};
-
 		}
 
@@ -123,4 +138,5 @@
 				return 0;
 			}
+
 			if (mode == "error") {
 				Log.Warning ("Steam OpenID login error: " + getValue (_req, "openid.error"));
@@ -128,6 +144,8 @@
 					PrintOpenIdResponse (_req);
 				}
+
 				return 0;
 			}
+
 			string steamIdString = getValue (_req, "openid.claimed_id");
 			ulong steamId = 0;
@@ -140,4 +158,5 @@
 					PrintOpenIdResponse (_req);
 				}
+
 				return 0;
 			}
@@ -161,5 +180,5 @@
 
 			byte[] postData = Encoding.ASCII.GetBytes (buildUrlParams (queryParams));
-			HttpWebRequest request = (HttpWebRequest)WebRequest.Create (STEAM_LOGIN);
+			HttpWebRequest request = (HttpWebRequest) WebRequest.Create (STEAM_LOGIN);
 			request.Method = "POST";
 			request.ContentType = "application/x-www-form-urlencoded";
@@ -170,5 +189,5 @@
 			}
 
-			HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
+			HttpWebResponse response = (HttpWebResponse) request.GetResponse ();
 			string responseString = null;
 			using (Stream st = response.GetResponseStream ()) {
@@ -180,8 +199,8 @@
 			if (responseString.ToLower ().Contains ("is_valid:true")) {
 				return steamId;
-			} else {
-				Log.Warning ("Steam OpenID login failed: {0}", responseString);
-				return 0;
-			}
+			}
+
+			Log.Warning ("Steam OpenID login failed: {0}", responseString);
+			return 0;
 		}
 
@@ -192,4 +211,5 @@
 				paramsArr [i++] = kvp.Key + "=" + Uri.EscapeDataString (kvp.Value);
 			}
+
 			return string.Join ("&", paramsArr);
 		}
@@ -200,4 +220,5 @@
 				throw new MissingMemberException ("OpenID parameter \"" + _name + "\" missing");
 			}
+
 			return nvc [_name];
 		}
@@ -209,6 +230,4 @@
 			}
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/Web.cs
===================================================================
--- binary-improvements/MapRendering/Web/Web.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/Web.cs	(revision 325)
@@ -1,5 +1,4 @@
 using System;
 using System.Collections.Generic;
-using System.Collections.Specialized;
 using System.IO;
 using System.Net;
@@ -8,28 +7,18 @@
 using System.Text;
 using System.Threading;
+using AllocsFixes.FileCache;
+using AllocsFixes.NetConnections.Servers.Web.Handlers;
 using UnityEngine;
 
-using AllocsFixes.NetConnections.Servers.Web.Handlers;
-
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public class Web : IConsoleServer {
 		private const int GUEST_PERMISSION_LEVEL = 2000;
+		public static int handlingCount;
+		public static int currentHandlers;
+		public static long totalHandlingTime = 0;
 		private readonly HttpListener _listener = new HttpListener ();
-		private Dictionary<string, PathHandler> handlers = new Dictionary<string, PathHandler> ();
-		public static int handlingCount = 0;
-		public static int currentHandlers = 0;
-		public static long totalHandlingTime = 0;
-		private string dataFolder;
-		private bool useStaticCache = false;
-
-		public static bool isSslRedirected (HttpListenerRequest req) {
-			string proto = req.Headers ["X-Forwarded-Proto"];
-			if (!string.IsNullOrEmpty (proto)) {
-				return proto.Equals ("https", StringComparison.OrdinalIgnoreCase);
-			}
-
-			return false;
-		}
+		private readonly string dataFolder;
+		private readonly Dictionary<string, PathHandler> handlers = new Dictionary<string, PathHandler> ();
+		private readonly bool useStaticCache;
 
 		public ConnectionHandler connectionHandler;
@@ -42,5 +31,7 @@
 					return;
 				}
-				if (!Directory.Exists (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) + "/webserver")) {
+
+				if (!Directory.Exists (Path.GetDirectoryName (Assembly.GetExecutingAssembly ().Location) +
+				                       "/webserver")) {
 					Log.Out ("Webserver not started (folder \"webserver\" not found in WebInterface mod folder)");
 					return;
@@ -56,39 +47,39 @@
 					return;
 				}
- 
-				handlers.Add (
-						"/index.htm",
-						new SimpleRedirectHandler ("/static/index.html"));
-				handlers.Add (
-						"/favicon.ico",
-						new SimpleRedirectHandler ("/static/favicon.ico"));
-				handlers.Add (
+
+				handlers.Add (
+					"/index.htm",
+					new SimpleRedirectHandler ("/static/index.html"));
+				handlers.Add (
+					"/favicon.ico",
+					new SimpleRedirectHandler ("/static/favicon.ico"));
+				handlers.Add (
+					"/session/",
+					new SessionHandler (
 						"/session/",
-						new SessionHandler (
-									"/session/",
-									dataFolder,
-									this)
-				);
-				handlers.Add (
-						"/userstatus",
-						new UserStatusHandler ()
+						dataFolder,
+						this)
+				);
+				handlers.Add (
+					"/userstatus",
+					new UserStatusHandler ()
 				);
 				if (useStaticCache) {
 					handlers.Add (
+						"/static/",
+						new StaticHandler (
 							"/static/",
-							new StaticHandler (
-									"/static/",
-									dataFolder,
-									new AllocsFixes.FileCache.SimpleCache (),
-									false)
+							dataFolder,
+							new SimpleCache (),
+							false)
 					);
 				} else {
 					handlers.Add (
+						"/static/",
+						new StaticHandler (
 							"/static/",
-							new StaticHandler (
-									"/static/",
-									dataFolder,
-									new AllocsFixes.FileCache.DirectAccess (),
-									false)
+							dataFolder,
+							new DirectAccess (),
+							false)
 					);
 				}
@@ -118,10 +109,10 @@
 				connectionHandler = new ConnectionHandler (this);
 
-				_listener.Prefixes.Add (String.Format ("http://*:{0}/", webPort + 2));
+				_listener.Prefixes.Add (string.Format ("http://*:{0}/", webPort + 2));
 				_listener.Start ();
 
 				SdtdConsole.Instance.RegisterServer (this);
 
-				_listener.BeginGetContext (new AsyncCallback (HandleRequest), _listener);
+				_listener.BeginGetContext (HandleRequest, _listener);
 
 				Log.Out ("Started Webserver on " + (webPort + 2));
@@ -129,4 +120,30 @@
 				Log.Out ("Error in Web.ctor: " + e);
 			}
+		}
+
+		public void Disconnect () {
+			try {
+				_listener.Stop ();
+				_listener.Close ();
+			} catch (Exception e) {
+				Log.Out ("Error in Web.Disconnect: " + e);
+			}
+		}
+
+		public void SendLine (string line) {
+			connectionHandler.SendLine (line);
+		}
+
+		public void SendLog (string text, string trace, LogType type) {
+			// Do nothing, handled by LogBuffer internally
+		}
+
+		public static bool isSslRedirected (HttpListenerRequest req) {
+			string proto = req.Headers ["X-Forwarded-Proto"];
+			if (!string.IsNullOrEmpty (proto)) {
+				return proto.Equals ("https", StringComparison.OrdinalIgnoreCase);
+			}
+
+			return false;
 		}
 
@@ -135,7 +152,8 @@
 				Interlocked.Increment (ref handlingCount);
 				Interlocked.Increment (ref currentHandlers);
+
 //				MicroStopwatch msw = new MicroStopwatch ();
 				HttpListenerContext ctx = _listener.EndGetContext (result);
-				_listener.BeginGetContext (new AsyncCallback (HandleRequest), _listener);
+				_listener.BeginGetContext (HandleRequest, _listener);
 				try {
 					HttpListenerRequest request = ctx.Request;
@@ -163,5 +181,5 @@
 					// No game yet -> fail request
 					if (GameManager.Instance.World == null) {
-						response.StatusCode = (int)HttpStatusCode.ServiceUnavailable;
+						response.StatusCode = (int) HttpStatusCode.ServiceUnavailable;
 						return;
 					}
@@ -174,13 +192,12 @@
 							if (request.Url.AbsolutePath.StartsWith (kvp.Key)) {
 								if (!kvp.Value.IsAuthorizedForHandler (conn, permissionLevel)) {
-									response.StatusCode = (int)HttpStatusCode.Forbidden;
+									response.StatusCode = (int) HttpStatusCode.Forbidden;
 									if (conn != null) {
 										//Log.Out ("Web.HandleRequest: user '{0}' not allowed to access '{1}'", conn.SteamID, kvp.Value.ModuleName);
-									} else {
-										//Log.Out ("Web.HandleRequest: unidentified user from '{0}' not allowed to access '{1}'", request.RemoteEndPoint.Address, kvp.Value.ModuleName);
 									}
 								} else {
 									kvp.Value.HandleRequest (request, response, conn, permissionLevel);
 								}
+
 								return;
 							}
@@ -190,8 +207,9 @@
 					// Not really relevant for non-debugging purposes:
 					//Log.Out ("Error in Web.HandleRequest(): No handler found for path \"" + request.Url.AbsolutePath + "\"");
-					response.StatusCode = (int)HttpStatusCode.NotFound;
+					response.StatusCode = (int) HttpStatusCode.NotFound;
 				} catch (IOException e) {
 					if (e.InnerException is SocketException) {
-						Log.Out ("Error in Web.HandleRequest(): Remote host closed connection: " + e.InnerException.Message);
+						Log.Out ("Error in Web.HandleRequest(): Remote host closed connection: " +
+						         e.InnerException.Message);
 					} else {
 						Log.Out ("Error (IO) in Web.HandleRequest(): " + e);
@@ -203,4 +221,5 @@
 						ctx.Response.Close ();
 					}
+
 //					msw.Stop ();
 //					totalHandlingTime += msw.ElapsedMicroseconds;
@@ -223,15 +242,17 @@
 				if (con != null) {
 					_con = con;
-					return GameManager.Instance.adminTools.GetAdminToolsClientInfo (_con.SteamID.ToString ()).PermissionLevel;
+					return GameManager.Instance.adminTools.GetAdminToolsClientInfo (_con.SteamID.ToString ())
+						.PermissionLevel;
 				}
 			}
 
 			if (_req.QueryString ["adminuser"] != null && _req.QueryString ["admintoken"] != null) {
-				WebPermissions.AdminToken admin = WebPermissions.Instance.GetWebAdmin (_req.QueryString ["adminuser"], _req.QueryString ["admintoken"]);
+				WebPermissions.AdminToken admin = WebPermissions.Instance.GetWebAdmin (_req.QueryString ["adminuser"],
+					_req.QueryString ["admintoken"]);
 				if (admin != null) {
 					return admin.permissionLevel;
-				} else {
-					Log.Warning ("Invalid Admintoken used from " + _req.RemoteEndPoint.ToString ());
-				}
+				}
+
+				Log.Warning ("Invalid Admintoken used from " + _req.RemoteEndPoint);
 			}
 
@@ -242,10 +263,12 @@
 						WebConnection con = connectionHandler.LogIn (id, _req.RemoteEndPoint.Address.ToString ());
 						_con = con;
-						int level = GameManager.Instance.adminTools.GetAdminToolsClientInfo (id.ToString ()).PermissionLevel;
-						Log.Out ("Steam OpenID login from {0} with ID {1}, permission level {2}", _req.RemoteEndPoint.ToString (), con.SteamID, level);
+						int level = GameManager.Instance.adminTools.GetAdminToolsClientInfo (id.ToString ())
+							.PermissionLevel;
+						Log.Out ("Steam OpenID login from {0} with ID {1}, permission level {2}",
+							_req.RemoteEndPoint.ToString (), con.SteamID, level);
 						return level;
-					} else {
-						Log.Out ("Steam OpenID login failed from {0}", _req.RemoteEndPoint.ToString ());
-					}
+					}
+
+					Log.Out ("Steam OpenID login failed from {0}", _req.RemoteEndPoint.ToString ());
 				} catch (Exception e) {
 					Log.Error ("Error validating login:");
@@ -255,21 +278,4 @@
 
 			return GUEST_PERMISSION_LEVEL;
-		}
-
-		public void Disconnect () {
-			try {
-				_listener.Stop ();
-				_listener.Close ();
-			} catch (Exception e) {
-				Log.Out ("Error in Web.Disconnect: " + e);
-			}
-		}
-
-		public void SendLine (string line) {
-			connectionHandler.SendLine (line);
-		}
-
-		public void SendLog (string text, string trace, UnityEngine.LogType type) {
-			// Do nothing, handled by LogBuffer internally
 		}
 
@@ -281,5 +287,4 @@
 			resp.OutputStream.Write (buf, 0, buf.Length);
 		}
-
 	}
 }
Index: binary-improvements/MapRendering/Web/WebCommandResult.cs
===================================================================
--- binary-improvements/MapRendering/Web/WebCommandResult.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/WebCommandResult.cs	(revision 325)
@@ -1,17 +1,15 @@
 ﻿using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Net;
+using System.Net.Sockets;
 using System.Text;
+using System.Threading;
+using AllocsFixes.JSON;
+using AllocsFixes.NetConnections.Servers.Web.API;
+using UnityEngine;
 
-using AllocsFixes.JSON;
-using System.IO;
-using System.Net.Sockets;
-using System.Threading;
-using AllocsFixes.NetConnections.Servers.Web.API;
-
-namespace AllocsFixes.NetConnections.Servers.Web
-{
-	public class WebCommandResult : IConsoleConnection
-	{
+namespace AllocsFixes.NetConnections.Servers.Web {
+	public class WebCommandResult : IConsoleConnection {
 		public enum ResultType {
 			Full,
@@ -20,14 +18,15 @@
 		}
 
-		public static int handlingCount = 0;
-		public static int currentHandlers = 0;
-		public static long totalHandlingTime = 0;
+		public static int handlingCount;
+		public static int currentHandlers;
+		public static long totalHandlingTime;
+		private readonly string command;
+		private readonly string parameters;
 
-		private HttpListenerResponse response;
-		private string command;
-		private string parameters;
-		private ResultType responseType;
+		private readonly HttpListenerResponse response;
+		private readonly ResultType responseType;
 
-		public WebCommandResult (string _command, string _parameters, ResultType _responseType, HttpListenerResponse _response) {
+		public WebCommandResult (string _command, string _parameters, ResultType _responseType,
+			HttpListenerResponse _response) {
 			Interlocked.Increment (ref handlingCount);
 			Interlocked.Increment (ref currentHandlers);
@@ -65,9 +64,11 @@
 						result = resultObj;
 					}
+
 					WebAPI.WriteJSON (response, result);
 				}
 			} catch (IOException e) {
 				if (e.InnerException is SocketException) {
-					Log.Out ("Error in WebCommandResult.SendLines(): Remote host closed connection: " + e.InnerException.Message);
+					Log.Out ("Error in WebCommandResult.SendLines(): Remote host closed connection: " +
+					         e.InnerException.Message);
 				} else {
 					Log.Out ("Error (IO) in WebCommandResult.SendLines(): " + e);
@@ -85,4 +86,5 @@
 					Log.Out ("WebCommandResult.SendLines(): Took {0} µs", msw.ElapsedMicroseconds);
 				}
+
 				Interlocked.Decrement (ref currentHandlers);
 			}
@@ -93,9 +95,9 @@
 		}
 
-		public void SendLog (string _msg, string _trace, UnityEngine.LogType _type) {
+		public void SendLog (string _msg, string _trace, LogType _type) {
 			//throw new NotImplementedException ();
 		}
 
-		public void EnableLogLevel (UnityEngine.LogType _type, bool _enable) {
+		public void EnableLogLevel (LogType _type, bool _enable) {
 			//throw new NotImplementedException ();
 		}
@@ -106,3 +108,2 @@
 	}
 }
-
Index: binary-improvements/MapRendering/Web/WebConnection.cs
===================================================================
--- binary-improvements/MapRendering/Web/WebConnection.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/WebConnection.cs	(revision 325)
@@ -1,28 +1,27 @@
 using System;
 using System.Collections.Generic;
-using AllocsFixes.NetConnections.Servers.Web;
 using UnityEngine;
 
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public class WebConnection : ConsoleConnectionAbstract {
-		private string sessionId;
-		private string endpoint;
-		private ulong steamId;
-		private DateTime login;
+		private readonly DateTime login;
+		private readonly List<string> outputLines = new List<string> ();
 		private DateTime lastAction;
-		private List<string> outputLines = new List<string> ();
+		private readonly string conDescription;
 
-		public string SessionID {
-			get { return sessionId; }
+		public WebConnection (string _sessionId, string _endpoint, ulong _steamId) {
+			SessionID = _sessionId;
+			Endpoint = _endpoint;
+			SteamID = _steamId;
+			login = DateTime.Now;
+			lastAction = login;
+			conDescription = "WebPanel from " + Endpoint;
 		}
 
-		public string Endpoint {
-			get { return endpoint; }
-		}
+		public string SessionID { get; private set; }
 
-		public ulong SteamID {
-			get { return steamId; }
-		}
+		public string Endpoint { get; private set; }
+
+		public ulong SteamID { get; private set; }
 
 		public TimeSpan Age {
@@ -30,52 +29,48 @@
 		}
 
-        public static bool CanViewAllPlayers (int _permissionLevel) {
-            bool val = false;
+		public static bool CanViewAllPlayers (int _permissionLevel) {
+			bool val = false;
 
-            try {
-                const int defaultPermissionLevel = 0;
+			try {
+				const int defaultPermissionLevel = 0;
 
-                val = _permissionLevel <= defaultPermissionLevel;
+				val = _permissionLevel <= defaultPermissionLevel;
 
-                foreach (WebPermissions.WebModulePermission wap in WebPermissions.Instance.GetModules ())
-                    if (wap.module.Trim ().ToLower () == "webapi.viewallplayers")
-                        val = _permissionLevel <= wap.permissionLevel;
-            }
-            catch { }
+				foreach (WebPermissions.WebModulePermission wap in WebPermissions.Instance.GetModules ()) {
+					if (wap.module.Trim ().ToLower () == "webapi.viewallplayers") {
+						val = _permissionLevel <= wap.permissionLevel;
+					}
+				}
+			} catch {
+			}
 
-            return val;
-        }
+			return val;
+		}
 
-        public static bool CanViewAllClaims (int _permissionLevel) {
-            bool val = false;
+		public static bool CanViewAllClaims (int _permissionLevel) {
+			bool val = false;
 
-            try {
-                const int defaultPermissionLevel = 0;
+			try {
+				const int defaultPermissionLevel = 0;
 
-                val = _permissionLevel <= defaultPermissionLevel;
+				val = _permissionLevel <= defaultPermissionLevel;
 
-                foreach (WebPermissions.WebModulePermission wap in WebPermissions.Instance.GetModules ())
-                    if (wap.module.Trim ().ToLower () == "webapi.viewallclaims")
-                        val = _permissionLevel <= wap.permissionLevel;
-            }
-            catch { }
+				foreach (WebPermissions.WebModulePermission wap in WebPermissions.Instance.GetModules ()) {
+					if (wap.module.Trim ().ToLower () == "webapi.viewallclaims") {
+						val = _permissionLevel <= wap.permissionLevel;
+					}
+				}
+			} catch {
+			}
 
-            return val;
-        }
-
-		public WebConnection (string _sessionId, string _endpoint, ulong _steamId) {
-			this.sessionId = _sessionId;
-			this.endpoint = _endpoint;
-			this.steamId = _steamId;
-			this.login = DateTime.Now;
-			this.lastAction = this.login;
+			return val;
 		}
 
 		public void UpdateUsage () {
-			this.lastAction = DateTime.Now;
+			lastAction = DateTime.Now;
 		}
 
 		public override string GetDescription () {
-			return "WebPanel from " + endpoint;
+			return conDescription;
 		}
 
@@ -91,6 +86,4 @@
 			// Do nothing, handled by LogBuffer
 		}
-
 	}
 }
-
Index: binary-improvements/MapRendering/Web/WebPermissions.cs
===================================================================
--- binary-improvements/MapRendering/Web/WebPermissions.cs	(revision 324)
+++ binary-improvements/MapRendering/Web/WebPermissions.cs	(revision 325)
@@ -1,29 +1,19 @@
-using System;
 using System.Collections.Generic;
 using System.IO;
 using System.Xml;
 
-namespace AllocsFixes.NetConnections.Servers.Web
-{
+namespace AllocsFixes.NetConnections.Servers.Web {
 	public class WebPermissions {
-		private static WebPermissions instance = null;
-
-		public static WebPermissions Instance {
-			get {
-				lock (typeof(WebPermissions)) {
-					if (instance == null) {
-						instance = new WebPermissions ();
-					}
-					return instance;
-				}
-			}
-		}
-
 		private const string PERMISSIONS_FILE = "webpermissions.xml";
-		Dictionary<string, AdminToken> admintokens;
-		Dictionary<string, WebModulePermission> modules;
-		Dictionary<string, WebModulePermission> knownModules = new Dictionary<string, WebModulePermission> ();
-		WebModulePermission defaultModulePermission = new WebModulePermission ("", 0);
-		FileSystemWatcher fileWatcher;
+		private static WebPermissions instance;
+		private readonly WebModulePermission defaultModulePermission = new WebModulePermission ("", 0);
+
+		private readonly Dictionary<string, WebModulePermission> knownModules =
+			new Dictionary<string, WebModulePermission> ();
+
+		private Dictionary<string, AdminToken> admintokens;
+		private FileSystemWatcher fileWatcher;
+
+		private Dictionary<string, WebModulePermission> modules;
 
 		public WebPermissions () {
@@ -33,4 +23,16 @@
 		}
 
+		public static WebPermissions Instance {
+			get {
+				lock (typeof (WebPermissions)) {
+					if (instance == null) {
+						instance = new WebPermissions ();
+					}
+
+					return instance;
+				}
+			}
+		}
+
 		public bool ModuleAllowedWithLevel (string _module, int _level) {
 			WebModulePermission permInfo = GetModulePermission (_module);
@@ -41,7 +43,7 @@
 			if (IsAdmin (_name) && admintokens [_name].token == _token) {
 				return admintokens [_name];
-			} else {
-				return null;
-			}
+			}
+
+			return null;
 		}
 
@@ -50,4 +52,5 @@
 				return modules [_module.ToLower ()];
 			}
+
 			return defaultModulePermission;
 		}
@@ -83,5 +86,5 @@
 			return result;
 		}
-	
+
 
 		// Commands
@@ -99,7 +102,8 @@
 			if (!string.IsNullOrEmpty (_module)) {
 				lock (this) {
-                    if (!IsKnownModule( _module)) {
+					if (!IsKnownModule (_module)) {
 						knownModules.Add (_module, new WebModulePermission (_module, _defaultPermission));
-                    }
+					}
+
 					if (_defaultPermission > 0 && !modules.ContainsKey (_module.ToLower ())) {
 						AddModulePermission (_module, _defaultPermission);
@@ -114,9 +118,9 @@
 					return knownModules.ContainsKey (_module);
 				}
-			} else {
-				return false;
-			}
-		}
-	
+			}
+
+			return false;
+		}
+
 		public void RemoveModulePermission (string _module, bool _save = true) {
 			lock (this) {
@@ -140,5 +144,5 @@
 			return result;
 		}
-	
+
 
 		//IO Tasks
@@ -146,7 +150,7 @@
 		private void InitFileWatcher () {
 			fileWatcher = new FileSystemWatcher (GetFilePath (), GetFileName ());
-			fileWatcher.Changed += new FileSystemEventHandler (OnFileChanged);
-			fileWatcher.Created += new FileSystemEventHandler (OnFileChanged);
-			fileWatcher.Deleted += new FileSystemEventHandler (OnFileChanged);
+			fileWatcher.Changed += OnFileChanged;
+			fileWatcher.Created += OnFileChanged;
+			fileWatcher.Deleted += OnFileChanged;
 			fileWatcher.EnableRaisingEvents = true;
 		}
@@ -198,4 +202,5 @@
 							continue;
 						}
+
 						if (subChild.NodeType != XmlNodeType.Element) {
 							Log.Warning ("Unexpected XML node found in 'admintokens' section: " + subChild.OuterXml);
@@ -203,18 +208,21 @@
 						}
 
-						XmlElement lineItem = (XmlElement)subChild;
+						XmlElement lineItem = (XmlElement) subChild;
 
 						if (!lineItem.HasAttribute ("name")) {
-							Log.Warning ("Ignoring admintoken-entry because of missing 'name' attribute: " + subChild.OuterXml);
+							Log.Warning ("Ignoring admintoken-entry because of missing 'name' attribute: " +
+							             subChild.OuterXml);
 							continue;
 						}
 
 						if (!lineItem.HasAttribute ("token")) {
-							Log.Warning ("Ignoring admintoken-entry because of missing 'token' attribute: " + subChild.OuterXml);
+							Log.Warning ("Ignoring admintoken-entry because of missing 'token' attribute: " +
+							             subChild.OuterXml);
 							continue;
 						}
 
 						if (!lineItem.HasAttribute ("permission_level")) {
-							Log.Warning ("Ignoring admintoken-entry because of missing 'permission_level' attribute: " + subChild.OuterXml);
+							Log.Warning ("Ignoring admintoken-entry because of missing 'permission_level' attribute: " +
+							             subChild.OuterXml);
 							continue;
 						}
@@ -224,10 +232,11 @@
 						int permissionLevel = 2000;
 						if (!int.TryParse (lineItem.GetAttribute ("permission_level"), out permissionLevel)) {
-							Log.Warning ("Ignoring admintoken-entry because of invalid (non-numeric) value for 'permission_level' attribute: " + subChild.OuterXml);
-							continue;
-						}
-
-						AddAdmin (name, token, permissionLevel, false); 
-					
+							Log.Warning (
+								"Ignoring admintoken-entry because of invalid (non-numeric) value for 'permission_level' attribute: " +
+								subChild.OuterXml);
+							continue;
+						}
+
+						AddAdmin (name, token, permissionLevel, false);
 					}
 				}
@@ -238,4 +247,5 @@
 							continue;
 						}
+
 						if (subChild.NodeType != XmlNodeType.Element) {
 							Log.Warning ("Unexpected XML node found in 'permissions' section: " + subChild.OuterXml);
@@ -243,26 +253,29 @@
 						}
 
-						XmlElement lineItem = (XmlElement)subChild;
+						XmlElement lineItem = (XmlElement) subChild;
 
 						if (!lineItem.HasAttribute ("module")) {
-							Log.Warning ("Ignoring permission-entry because of missing 'module' attribute: " + subChild.OuterXml);
-							continue;
-						}
-					
+							Log.Warning ("Ignoring permission-entry because of missing 'module' attribute: " +
+							             subChild.OuterXml);
+							continue;
+						}
+
 						if (!lineItem.HasAttribute ("permission_level")) {
-							Log.Warning ("Ignoring permission-entry because of missing 'permission_level' attribute: " + subChild.OuterXml);
-							continue;
-						}
-					
+							Log.Warning ("Ignoring permission-entry because of missing 'permission_level' attribute: " +
+							             subChild.OuterXml);
+							continue;
+						}
+
 						int permissionLevel = 0;
 						if (!int.TryParse (lineItem.GetAttribute ("permission_level"), out permissionLevel)) {
-							Log.Warning ("Ignoring permission-entry because of invalid (non-numeric) value for 'permission_level' attribute: " + subChild.OuterXml);
-							continue;
-						}
-
-						AddModulePermission (lineItem.GetAttribute ("module").ToLower (), permissionLevel, false); 
-					}
-				}
-
+							Log.Warning (
+								"Ignoring permission-entry because of invalid (non-numeric) value for 'permission_level' attribute: " +
+								subChild.OuterXml);
+							continue;
+						}
+
+						AddModulePermission (lineItem.GetAttribute ("module").ToLower (), permissionLevel, false);
+					}
+				}
 			}
 
@@ -273,40 +286,47 @@
 			fileWatcher.EnableRaisingEvents = false;
 
-			using (StreamWriter sw = new StreamWriter(GetFullPath ())) {
-                sw.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
-                sw.WriteLine ("<webpermissions>");
-                sw.WriteLine  ();
-                sw.WriteLine ("	<admintokens>");
-                sw.WriteLine ("		<!-- <token name=\"adminuser1\" token=\"supersecrettoken\" permission_level=\"0\" /> -->");
-                foreach (AdminToken at in admintokens.Values) {
-                    sw.WriteLine (string.Format ("		<token name=\"{0}\" token=\"{1}\" permission_level=\"{2}\" />", at.name, at.token, at.permissionLevel));
-                }
-                sw.WriteLine ("	</admintokens>");
-                sw.WriteLine ();
-                sw.WriteLine ("	<permissions>");
-                foreach (WebModulePermission wap in modules.Values) {
-                    sw.WriteLine (string.Format ("		<permission module=\"{0}\" permission_level=\"{1}\" />", wap.module, wap.permissionLevel));
-                }
-                sw.WriteLine ("		<!-- <permission module=\"web.map\" permission_level=\"1000\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getlog\" permission_level=\"0\" /> -->");
-                sw.WriteLine ("		<!-- <permission module=\"webapi.executeconsolecommand\" permission_level=\"0\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getstats\" permission_level=\"1000\" /> -->");
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getplayersonline\" permission_level=\"1000\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getplayerslocation\" permission_level=\"1000\" /> -->");
-                sw.WriteLine ("		<!-- <permission module=\"webapi.viewallplayers\" permission_level=\"1\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getlandclaims\" permission_level=\"1000\" /> -->");
-                sw.WriteLine ("		<!-- <permission module=\"webapi.viewallclaims\" permission_level=\"1\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getplayerinventory\" permission_level=\"1\" /> -->");
-                sw.WriteLine ();
-                sw.WriteLine ("		<!-- <permission module=\"webapi.gethostilelocation\" permission_level=\"1\" /> -->");
-                sw.WriteLine ("		<!-- <permission module=\"webapi.getanimalslocation\" permission_level=\"1\" /> -->");
-                sw.WriteLine ("	</permissions>");
-                sw.WriteLine ();
-                sw.WriteLine ("</webpermissions>");
+			using (StreamWriter sw = new StreamWriter (GetFullPath ())) {
+				sw.WriteLine ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+				sw.WriteLine ("<webpermissions>");
+				sw.WriteLine ();
+				sw.WriteLine ("	<admintokens>");
+				sw.WriteLine (
+					"		<!-- <token name=\"adminuser1\" token=\"supersecrettoken\" permission_level=\"0\" /> -->");
+				foreach (AdminToken at in admintokens.Values) {
+					sw.WriteLine ("		<token name=\"{0}\" token=\"{1}\" permission_level=\"{2}\" />", at.name, at.token,
+						at.permissionLevel);
+				}
+
+				sw.WriteLine ("	</admintokens>");
+				sw.WriteLine ();
+				sw.WriteLine ("	<permissions>");
+				foreach (WebModulePermission wap in modules.Values) {
+					sw.WriteLine ("		<permission module=\"{0}\" permission_level=\"{1}\" />", wap.module,
+						wap.permissionLevel);
+				}
+
+				sw.WriteLine ("		<!-- <permission module=\"web.map\" permission_level=\"1000\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getlog\" permission_level=\"0\" /> -->");
+				sw.WriteLine (
+					"		<!-- <permission module=\"webapi.executeconsolecommand\" permission_level=\"0\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getstats\" permission_level=\"1000\" /> -->");
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getplayersonline\" permission_level=\"1000\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine (
+					"		<!-- <permission module=\"webapi.getplayerslocation\" permission_level=\"1000\" /> -->");
+				sw.WriteLine ("		<!-- <permission module=\"webapi.viewallplayers\" permission_level=\"1\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getlandclaims\" permission_level=\"1000\" /> -->");
+				sw.WriteLine ("		<!-- <permission module=\"webapi.viewallclaims\" permission_level=\"1\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getplayerinventory\" permission_level=\"1\" /> -->");
+				sw.WriteLine ();
+				sw.WriteLine ("		<!-- <permission module=\"webapi.gethostilelocation\" permission_level=\"1\" /> -->");
+				sw.WriteLine ("		<!-- <permission module=\"webapi.getanimalslocation\" permission_level=\"1\" /> -->");
+				sw.WriteLine ("	</permissions>");
+				sw.WriteLine ();
+				sw.WriteLine ("</webpermissions>");
 
 				sw.Flush ();
@@ -318,9 +338,8 @@
 
 
-		
 		public class AdminToken {
 			public string name;
+			public int permissionLevel;
 			public string token;
-			public int permissionLevel;
 
 			public AdminToken (string _name, string _token, int _permissionLevel) {
@@ -340,7 +359,4 @@
 			}
 		}
-
-
 	}
 }
-
