Major evolution in neural_net implementation

Plus minor fixes