Finishing up the directory server functions.

Finished parsing of the directory listing, and did a little bit of
refactoring.