Started moving p2mining code out to module