Improve decode speed by ~50%; nbd

https://gist.github.com/naomik/6473346