Ammonia-based thermoelectrochemical systems and methods