Two quick comments:
Hydrogen is commercially produced from methane, with CO2 as a byproduct. It would be better to use the methane directly: less energy loss for the same emission. Only a small amount is produced through water electrolysis.
Ammonia is nasty stuff. It's one of the most dangerous chemicals today - probably just under carbon monoxide. The reasons CFCs were introduced as refrigerants in around the 1920's is because people were dropping like flies from ammonia accidents.