change main and controller into controller package, rename main to mainController
rename mainController reference
create main object and test object, main for basic functions, test for test case
change the class structure, change sub-functions declarations, add a close operation at last