Moved the "optimize" function from encoder to optimizer.

This CL makes the "find the next encoder to try" function part of the
optimizer, not the encoder; this will make it easier to incorporate
more algorithms for picking the right encoder.

It also fixes two unrelated bugs - a wrong limit on VP8 and VP9 encode time,
and a print statement that shouldn't have been there.