Replace OpenSSL hash functions with built-in implementations

* Introduces the classes CSHA256 and CSHA512 in crypto/sha2.{cpp,h}, CSHA1 in crypto/sha1.{cpp,h} and CRIPEMD160 in crypto/ripemd160.{cpp,h}.
* The HMAC-SHA512 implementation is moved to sha2.{cpp,h} as well, with a similar interface.
* In hash.h, CHash256 (=double SHA256) and CHash160 (SHA256 + RIPEMD160) are added.
* The rest of hash.h is refactored to use those classes.
* The internal miner is also modified to use CHash256 (hiding the inner SHA256 workings).
* The getwork() RPC call is removed.