First implementation of reference density equations.
Merge branch 'reference_density_state' into zhong08