Leaders gather, thousands sing in rain in farewell to Mandela