Parallelize gradient descent loop, add batch_size option, some
refactoring