Move shardstatemanager into core

This will make it easier to use in other modules (statsd).