Python solver improvements

These commits expose `SGDSolver.test_nets` and `SGDSolver.iter` for more elaborate use of the solver from Python.

This should allow, e.g., `MemoryDataLayer` to be used with a test net, as discussed at #912. It also lets one write Python scripts that do testing during solving that goes beyond an average over something computed batchwise.

There are more improvements coming (eventually), but this should be mergeable as-is.