Add sha2.cpp, with a native SHA256/SHA512 implementation.

This also moves the HMAC-SHA512 implementation there.
Switch script.cpp and hash.cpp to use sha2.cpp instead of OpenSSL.
Switch miner.cpp to use sha2 instead of OpenSSL.

This also removes the deprecated "midstate" and "hash1" fields from
getwork.