Merge grazcoin

Merged changes from grazcoin's repo, as of hash #c757e0845a27f377376b774ed026790f89d09f5d, and then fixed the stuff that I broke in doing so.