Fragment Update

Refactoring the layout ui and code to implement the use of fragments.
Added fragments to the main ui.