Refactor backend classify

This refactors the app.classify.backend package to make it more generic at no cost to performance. The highlights are that there is now a single linear example (the complexity of computing scores and accumulating gradients having been put in the same place, the linear model), and the training infrastructure has then been simplified to make it more generic.

This deletes a lot of code with no loss of functionality or efficiency.