moved functions and made Storage available to TextSplitter incl. check
if directory exists