Support diamond lattice generation.
Fix memory issues.

Fixed some leaks (not freeing data allocated by KIM). Also fixed memory
errors due to NLopt. Despite claims in the manual that it is possible to
use the same objective function as for the C API, it is actually
necessary to use the C++ style. This fixes weird errors that appeared
intermittently.
Support optimization of a, b, and c lattice constants.
Update TODO.