Refactor the code
Add unit tests for 'deps.js'