lib/HalDependencyResolver.js
function(describe) {
		if (!Array.isArray(describe.m)) {
			return when.reject('no modules in describe message');
		}

		var modules = [];
		var userModule = null;
		for (var i = 0; i < describe.m.length; i++) {
			var module = new FirmwareModule(describe.m[i]);
			//modules.push(module);

			if (module.isUserModule() && module.isMainLocation()) {
				userModule = describe.m[i];
			}
		}

		if (!userModule) {
			return when.resolve("no user module");
		}

		//return this._getModuleFirstDependecy(modules, userModule);

		for(var i=0;i<userModule.d.length;i++) {
			var dep = userModule.d[i];

			var deps = this._walkChain(describe.m, dep);
			if (deps && (deps.length > 0)) {
				// this function only originally returned one dependency.
				return when.reject([new FirmwareModule(deps[0])]);
			}
		}


//		if (deps && (deps.length > 0)) {
//			return when.reject(new FirmwareModule(deps[0]));
//		}
//		else {
			return when.resolve("nothing missing");
//		}
	}
function(describe) {
		if (!Array.isArray(describe.m)) {
			return when.reject('no modules in describe message');
		}

		var modules = [];
		var userModule = null;
		for (var i = 0; i < describe.m.length; i++) {
			var module = new FirmwareModule(describe.m[i]);
			//modules.push(module);

			if (module.isUserModule() && module.isMainLocation()) {
				userModule = describe.m[i];
			}
		}

		if (!userModule) {
			return when.resolve("no user module");
		}

		//return this._getModuleFirstDependecy(modules, userModule);

		for(var i=0;i<userModule.d.length;i++) {
			var dep = userModule.d[i];

			var deps = this._walkChain(describe.m, dep);
			if (deps && (deps.length > 0)) {
				// this function only originally returned one dependency.
				return when.reject([new FirmwareModule(deps[0])]);
			}
		}


//		if (deps && (deps.length > 0)) {
//			return when.reject(new FirmwareModule(deps[0]));
//		}
//		else {
			return when.resolve("nothing missing");
//		}
	}
/*
given device's describe message figure out if it has
missing modules. Rejected value contains missing
dependencies

@param Object describe - describe message
@param Promise