[RFC] Refactor codebase

cc @mlubin @IainNZ 
The description makes it seem like an absolute gap, though solvers usually report a relative gap.