Seperate delta calculation of the implementation.

Move the delta calculation of the medial neurons to a helper method and
change the structure of the train test loop such that it is a direct
implementation of the algorithm described in the article.