Merge pull request #15 from jasonaowen/master

fix string encoding issue to work with ruby1.9
Check for URL already existing in db.
Add collision resolution.

In the rare case that SHA1 generates a duplicate hash for
different URLs, this must be handled.
Add error checking for nonexistent postfixes.