Moved #includes around to clarify dependencies.
Backpropagation factoring.