fixes qi encoding ns, checks constructed trees in test
Merge pull request #4 from nokamoto/develop

fixes qi encoding ns, checks constructed trees in test