Yes, the 'spooky to joyful' & back is because (although I have noted it in G major) the main key is E minor, going to E major for the joyful bit. My musical knowledge missed that until Eliza pointed out the sound!