Reorganize utilities

Move __unique_string, argument validations and __mad_version into
utilities
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
* Updated control.py_in to evaluate all forms of expression
* Removed old code, added comments