Dpc

Cheng Chang completed modularizing DPC code. We are ready for the code review. 

Dantong 
Cheng Chang
This is a controller part, while all the other functions are basic components to run dpc. So put this function into another file with name ..controller.py