implemented gradient test

  - implemented gradient calculation in nntrainer_test
  - fixed class inheritance typo