Handle -AMPL option separately from writesol
Handle -AMPL and wantsol in standard way