tweaked corpusFromHeaders to accept text vector instead of directory and amended example