fix Moocode detection, add ace_mode for Mercury

In #1098 added the Mercury language, but that broke the Moocode language, this PR fixes that.
Also add ace_mode to Mercury