Add miner.cpp/h

To replace code taken out of main