Take bindEvent out of the global scope.
Pad sequence with a 0 when end-of-code detected, to prevent problems with repetitive codes.
Add codeFromAlphaNumString method, document.