Move hash prototype definitions into prototypes.json

Move the definitions of the hash types into a separate file. Also use
re.compile() when loading in the json definitions.

Use a Unicode literal for str.format() so Python 2.7 can write Unicode
stirings.