Add input compatibility with standard trainers.

Now it can automatically reshape input that is in 2d matrix form.
Fixed the last issues that caused errors with SGD.

SGD is currently running as I type, I don't know the outcome,
but it no longer fails promptly with an error.