Update to retrain on a background thread

Also with this commit, there was a fix to libsvm. Training is working
now if there is data correllation.