Fix base64 encoding bug that causes url collisions

After  100 urls, the base64 function no longer encodes properly, resulting in collisions and breaking the shortener.

See http://jsfiddle.net/Dnr82/ for a demo with multiple collisions using the current base64 function.

I've tested the new base64 encode (using node Buffer) up to 5M urls without collisions.