Added RTF support
* Cleaned up PDF code.
* Cleaned up RTF.
Merge branch 'refactor-for-service'