Switched from opendir to readdir; added filetype filter

Since we're iterating over the directory anyway, we should use readdir.
We only care about .pdf documents.
Started to add support for multiple documents.