Refactor parsers; fix empty document behavior.
Rudimentary solution for PDF parsing (closes #18)