Fixed inifinite recursion in Deferred.js; more progress on unit tests