* Refactor miner and mine when waiting for block to validate * Fix -n to work after the refactor. Change foundBlockChan capacity. Use lock instead of atomic in the template manager. * Fix self assignment * Fix lock * Fix Dockerfile * Add comment