Refactored and fixes added.
See file "Fixes" for details.

Currently taking 4 seconds for 5 training iterations on 20 sentence pairs.