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 
@itsthatguy `require.main.filename` wasn't working with the tests, as it was resolving to mocha's bin directory. Do you see any issue with doing this instead? Do you have a better solution?