Finalized Mopt and added tests for it.