added unit tests for the sparse autoencoder, and added gradient checking