If I am understanding the usage of `MessageTypes`, it should be much simpler (if a little less DRY) to make this a lookup table of messageHandlers, keyed on message type, i.e.

```diff
- var MessageTypes = {
-   alarm: ['normal', 'snooze'],
-   timer: ['timer'],
-   ringer: ['ringer'],
-   close: ['close-alarm', 'close-timer']
- };
+ var MessageHandlers = {
+   normal: 'alarm',
+   snooze: 'alarm',
+   timer: 'timer',
+   ringer: 'ringer',
+   'close-alarm': 'close',
+   'close-timer': 'close'
+ };
```

...then, you could write, simply:

```diff
- if (type) {
-   var funcName;
-   for (var at in MessageTypes) {
-     if (typeof this[at] === 'function') {
-       MessageTypes[at].some(function(x) {
-         if (x === type.result) {
-           funcName = at;
-           return true;
-         }
-       });
-     }
-   }
-   if (funcName) {
-     this[funcName].call(this, message, done);
-     success = true;
-   }
- }
+ var handlerName = MessageHandlers[type.result];
+ if (typeof handleName === 'string') {
+   this[handlerName](message, done);
+ }
```