Ab initio study of gas phase and water-assisted tautomerization of maleimide and formamide