Added mkdirp, changed function formatTitle to safeTitle and working with RegExp.