Create missing folders, small refactoring

With this pull request the gem will create missing folders before it tries to save the word file. 
Some small refactoring was done regarding helper methods and in the way we build the paths