Refactor the code
Fix 'addBlock' method
Add unit tests for 'deps.js'