Fix optimizer selection.
Use clock_gettime.
Fix ilogcp tests.
Integrate David's changes.