cleanup and slight optimization

Most cleanup includes removal of unused variables. And the slight optimization is using constants instead of calling something like `":".charCodeAt(0)`. And in a decoder, tiny optimizations like these do matter.