In lyrics of rare humor, elegance and compassion, the man who put words to “Fiddler on the Roof” and “She Loves Me” explored the complex emotional architecture of love.