Removed non-const getter of energies in CFactor
Fixed malsar unit test. Closes #1630