refactoring+admin

Finish refactoring controllers
Finish using smarty
Add admin controller