Substitute sha module for hashlib.sha1

sha module is deprecated. hashlib is newer, more maintained and probably
faster (not that it really matters anyway), but more importantly, it's
the only module available on Python 3 (for the day when I decide to
port this thing to Py3k).