Improve the SHA-1 implementation

* Convert @ types to ~
* Move all of the inner functions from inside sha1() to top level, private functions
* The sha1() function now returns a ~ Sha1State struct instead of a type object
Create a Digest trait for common methods on digests and convert the Sha1 implementation to use it.
Implement the fixed output size versions of the SHA-2 digest functions.