use c++ features in ngt

also, add a few tests for ngt
improve c++ 11 for loops

use const references to map key-value pairs
Merge pull request #28 from js850/ngt_11

use c++ features in ngt