Added tab and swipe operations to MainActivity and refactored several methods and classes.