Update directory.js

This is what i have as of today - i will keep working at it. i've realised it wont be as big as originally thought. it actually could be quite simple.
Merge pull request #1 from jedwardadams/patch-1

Update directory.js