Core dissolution and the dynamics of massive stars in young stellar clusters