Preparation of high metal content nanoporous carbon