Vectorize LR cost and gradient (WIP)