Fix utf8 weirdness on tests

Fixes #629
Merge pull request #631 from pedrocunha/fix-for-failing-sphinx-tests

Fix utf8 weirdness on tests
Separating real-time directory preparation from data generation.
Merge remote-tracking branch 'origin/master'
Merge remote-tracking branch 'upstream/master'