Adding optimization algorithm tracking.

Refactored optimization algorithm model wrapper as well.