[functions] add state

This is not (yet) meant to be merged. I just needed a comparison on functions which opens up a pandora box of optional functionality on functions which we might want to have, althoug it will not be implemented by every function. Dumping the state of an object into a `Configuration` seemed the most straightforward way to me.