Some performance improvments
Merge pull request #31 from telehash/performance

Some performance improvments