Energy balances for propagating gravity currents: homogeneous and stratified ambients