Moved Wavelet code to lib