Add Maxwell relations for helmholtz free energy and port some code from cprop