nanshe/wavelet_transform.py: In wavelet_transform, optimized handling of intermediates when include_intermediates is True.
nanshe/wavelet_transform.py: For wavelet_transform, implemented in-place calculation for memory savings.