Perf improvements for sha1.js, sha2.js, and sha2_64b.js

Please see https://github.com/google/closure-library/pull/322 for the original PR. This is rebased and squashed.

CC @meheffernan @nanaze

This is rebased and squashed. @nanaze: Are the changes sufficient to make this work on Kindle Fire?