Compute cost and gradient for logistic regression

Compute cost and gradient for logistic regression with regularization