Nanoporous Graphene and H-BN from BCN Precursors: First-Principles Calculations