Added mdstatemanager and mdstate
Merged