Added MathFreeEnergy and tests for #4476

Adds MathFreeEnergy, which is the same free energy from MathCH, but implemented as a material. Closes #4476
P.S. your code accidentally works if you have only one variable in your problem, or pass the variables in the correct order.