Optimized

Using _sha512 instead of hashlib.
Only calculating "0"*difficulty once now.
start_string converted to ASCII.
No longer using 'test' variable to hold hash.
hash.startswith(null) replaced with hash[0:difficulty] == null.
When possible, digest() is used instead of hexdigest().