Rebase of Zuikkis "Scrypt-nfactor support!"

This is equivalent to https://github.com/Zuikkis/sgminer/commit/5ac07bc700dc0e0e433be04d7971e71a6f491b31 but omits the removal and re-addition of lines in `scrypt.c`.

Rebase of https://github.com/veox/sgminer/pull/110.