Rewrite CGMiner to use composition
Add serial retries to improve reliability
Minor control loop updates