Added core detection and a thread optimization param.
Borrowing sweet techniques from JThurman's sha testing code.
-O3 turns out to be slower than -O2 (wtf)
Merge pull request #27 from asm/master

Added core detection and a thread optimization param.