Revert "Tweak the helper functions"

On second thought, the old way is cleaner and faster.
See [this jsPerf on bind vs closure](http://jsperf.com/bind-vs-closure-setup/6)

This reverts commit 9fd5b9802b9e19f55b5f0753e9d6ddaf872d69f8.
Validate encodings