Add a Factory class for instantiation of objects from controllers

Also added layouts folder with a main.view.php file for the main layout and a home.view.php file for the home page.