Move clustering stuff into subdirectory.
Add training code.