Updated to parse Maildirs into a linked-list.

  We can now iterate over that and free it.
  Move the file/directory functions into util.c

  This seems more natural.