Refactored mining into utils and exposed it to ethereal. Partly fixes #43