Moving dtw lib to its own package

Code still needs some cleaning.