Rewrite dependencies.js

Less code + greater performance = WIN!
About 0.5ms performance gain on my machine, primarly by touching the DOM just once.
Lint tweaks
Fixed a small bug in dependencies.js
Fixed a (critical) typo
Merge pull request #1 from TuurDutoit/dependencies-rewrite

dependencies.js rewrite