Add clock to Miner
Change some behavior to support new time function