NNCOSTFUNCTION Implements the neural network cost function
for a two layer neural network which performs classification
todo: implement vectorized form of the cost function