WIP: Connect to ECOS through MathProgBase

As well as other refactorings related to this

(obviously don't merge yet)