util: add varInt encoding helper
Merge pull request #25 from jgarzik/txtool1

util: add varInt encoding helper