Add file IO and make NN base class abstact