Director recipe refactoring

Adding tests, sanitizing variables and templates
Some changes to director/storages.

FIXME! Still unusable.
Merge branch 'refactoring'
More director's tests