Fixing the case where a single char is provided from breaking the algorithm

- Also making the algorithm more verbose, for the sake of readability

#6 
:thumbsup: on moving this into a function. 

I think [charCodeAt](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt) is supposed to take an integer, so while this works it'd be [much faster](http://jsperf.com/default-to-0-vs-0/5) to change it from a string.