Create tmp folder if it doesn't exists
Small refactoring

Change the way of building paths, separate helper methods from Document
class
Merge remote-tracking branch 'upstream/master'
Merge pull request #3 from anitsirc/master

Create missing folders, small refactoring