Move density fitting checkpointing into state
The density fitting state and the data to checkpoint are one and the
same and should be treated in the same place. Moving the checkpointing
infrastructure for density fitting code into the state and closer to the
data that is to be checkpointed makes it easier to ensure that all
necessary data is writtten to a checkpoint file.
Introduced variable names to make sure that reading and writing from the
key-value-tree is symmetric and does not include typos.
Added read/write functions in checkpoint.h to simplify checkpoint
writing for this and other modules.
Change-Id: Ie7fa5e22333251db9050bb4491e61681651aa5c2