Mock out Cocoa run loop while running unit tests.
Address Code review comments.

Change argument containers from arrays to dictionaries.