sped up classification and training by 3x/2x respectively, broke out different portions of code to be more modular, added cython for some speedups