Add momentum unittests.
Fix momentum variable names.
Make foreach loop indices immutable.