Co-based ternary nanocomposites: synthesis and their superior performances for hydrogenation of p-nitrophenol and adsorption for methyl blue