Changed framework of MainActivity to use fragments.