Refactor PhpWord to reduce dependencies