model.optimize select a qp solver by default

This is a fix for model.optimize. When no solver is passed in, either gurobi or cplex is used (if available) instead of glpk if a quadratic objective is given. Also added consistency checks for quadratic_component as described in the comments.

At one point I was very frustrated over importing the right things to import. I just gave up and imported scipy. I hope this is not a big issue.