Moving the function that writes Haar wavelet to files to a common function files.