#7: Refactored to two files.

One file for generic PDF creation. Second for specialized tasks.
Tests rewritten after refactoring (#7).