Fixed bug in composition decay. Cleaned up resource heritage tracking - fixed it and added stateId to resource interface.