ModuleDB: Added new System.Object overloads for use with reflection, and some debug code.
ModuleDB: Added new System.Object overloads for use with reflection, and some debug code.

--- a/ModuleDB.cs
+++ b/ModuleDB.cs
@@ -50,6 +50,12 @@
 				if (_instance == null)
 				{
 					_instance = new ModuleDB<T>();
+					#if DEBUG
+					Debug.Log(string.Format("[ModuleDB<{0}>]: Built new instance {1}.",
+						typeof(T).Name,
+						_instance
+					));
+					#endif
 				}
 
 				return _instance;
@@ -88,6 +94,11 @@
 			#if BENCH
 			this.cacheHits = 0;
 			this.cacheMisses = 0;
+			#endif
+
+			#if DEBUG
+			Debug.Log(string.Format("[ModuleDB<{0}>]: Constructed.",
+				this.GetType().Name));
 			#endif
 		}
 
@@ -271,6 +282,27 @@
 			return vesselPartModuleDB[id][part.uid];
 		}
 
+		public List<T> getModules(System.Object obj)
+		{
+			if (obj is Vessel)
+			{
+				return this.getModules(obj as Vessel);
+			}
+			else if (obj is Part)
+			{
+				return this.getModules(obj as Part);
+			}
+			else
+			{
+				throw new ArgumentException(
+					string.Format(
+						"[ModuleDB<{0}>].getModules is only defined for Vessel and Part objects.",
+						typeof(T).Name
+					)
+				);
+			}
+		}
+
 		// Returns true if the given Vessel exists in the deep cache, false otherwise.
 		public bool inDeepCache(Vessel vessel)
 		{
@@ -296,10 +328,48 @@
 			}
 		}
 
+		public bool inDeepCache(System.Object obj)
+		{
+			if (obj is Vessel)
+			{
+				return this.inDeepCache(obj as Vessel);
+			}
+			else if (obj is Part)
+			{
+				return this.inDeepCache(obj as Part);
+			}
+			else
+			{
+				throw new ArgumentException(
+					string.Format(
+						"[ModuleDB<{0}>].inDeepCache is only defined for Vessel and Part objects.",
+						typeof(T).Name
+					)
+				);
+			}
+		}
+
 		// Returns true if the given Vessel exists in the shallow cache, false otherwise.
 		public bool inShallowCache(Vessel vessel)
 		{
 			return vesselModuleTable.ContainsKey(HighLogic.LoadedSceneIsEditor ? this.editorVesselID : vessel.id);
+		}
+
+		public bool inShallowCache(System.Object obj)
+		{
+			if (obj is Vessel)
+			{
+				return this.inShallowCache(obj as Vessel);
+			}
+			else
+			{
+				throw new ArgumentException(
+					string.Format(
+						"[ModuleDB<{0}>].inShallowCache is only defined for Vessel objects.",
+						typeof(T).Name
+					)
+				);
+			}
 		}
 
 		#if BENCH