Merge pull request #16 from oleksiyk/performance

Small refactoring
Merge pull request #17 from oleksiyk/performance

Fix encoding signed int64 and sint64