Improved the SPADE implementation to use the hard disk and to not overflow the memory. Also introduced some improvements in the implementation.