Confined red phosphorus in N-doped hierarchically porous carbon for lithium ion batteries with enhanced rate capability and cycle stability