Adding a bulk mode for cross validation
Adding bulk mode for detection and training files -with fixes-
Closing Octave threads after finishing
Some refactoring for the detection functions