Change state module and its tests to be more consistent with the rest of the toolkit