Formation mechanism and optimization of highly luminescent N-doped graphene quantum dots