Logistic Regression: Refactor iteration controller

Replace the iteration controller with the one defined in utilities.

Other minor changes:
* Move all code into Python
* All internal functions now starts with __
* Added argument validation for logistic regression
* In cv_utils, added functions to help return array from Python to older
  versions of database system. However, its usage in logistic regression
  turns to be unnecessary

Remaining problem:
* IGD final function is not used in the original aggregate function
  definition. It just returns the state and tries to catch some error.
  When the final function is added, an "array out of boundary" is
  thrown for the dataset log_breast_cancer_wisconsin, which
  is not the error that the IGD final function tries to catch, but a
  different error caused by itself.