Use binary search for getting optimal length

This provides some performance improvements over using a linear search.
Quote keywords and dictionary accesses

The "char" bareword causes issues with some JS compressors including
yui-compressor and shrinksafe.

Fixes: #1
Update files in dist/
Restore text if ellipsization is not necessary

This fixes a regression where the text of the element is replaced by 'a' if
ellipsization is not necessary.
Fix jslint errors
Use ceil() instead of floor() for midpoint calculation

This allows us to drop the if (start === length) kludge, while ensuring that
text.slice(0, end) is tested, fixing an off-by-one error that occurs when the
loop ends with (end - start) == 1.
Add .gitignore file