Improve handling of file conversion errors
Separate PDF output code into its own method
Implement pass-through of PDF source files

Also reorganized DocumentsController#convert to avoid deep nested if
statements.
Simplify comments
Create functional tests for DocumentsController