Feedforward improvements.

Makes a step towards addressing #109, though still not optimal. At the
beginning of the feedforward algorithm, finds both a starting layer and
an ending layer (the old behaviour was to just find a starting layer).
Then it works forward from the starting layers, as before.