Massive refactoring to implement tree walk kernel + spectral clustering of images. Still debugging.