Didn't quite a lot of them also leave after Indonesia achieved independence?
Well, no. AFAIK most, if not all, of Chinese-Indonesians were supporting the independence movement, especially during 1940s Japanese occupation. Although I will admit that after the independence the Chinese-Indonesians and native Indonesians had been undergoing an on-off relationship...
If I recall correctly, in the colonial era the Chinese had been at times a privileged minority (forming a class between, like the Tutsi's had been in Rwanda).
Yes. The Dutch established a caste system in Indonesia, in which the third and last class was for the natives, the second class for Chinese, Arabs, and other "oriental foreigners", while the first class was reserved for the Europeans. (this was a classic colonial strategy for the Europeans, in fact Britain and France used same strategy in their African and Middle-Eastern colonies, by using local Jewish or Christian communities as a "buffer" between the indigenous populations and European colonists)
Then again, I distinctly remember the Chinese population of Jakarta/Batavia being massacred at least once.
Yes again. In October 9, 1740, there was some "clash" between the Dutch and the Chinese-Indonesians in Batavia, which resulted in a whole-scale massacre...