modify Reg class, start model class,fix bug in View class

change the way Reg class behaves; added some test; fix a bug in
view->display