Code cleanup and first implementation of Storkey learning rule

Fixed a bug in which weights were computed twice
Avoid wasting time computing weights along the diagonal