Facile and generalized encapsulations of inorganic nanocrystals with nitrogen-doped carbonaceous coating for multifunctionality.