Implemented train method in nntrainer.py. Untested.