Rebuild StateRegistry storage so IDs across modules work

As it stands the following will fail as we didn't allow duplicate IDs
under any circumstances:

    with Pkg.installed("nginx"):
    	Service.running("nginx")

This commit changes the way the StateRegistry stores states to allow the
above example to work properly.

Now it behaves much more closely to the YAML + Jinja renderer.