cleaned up Main and Learn. Refactored and modularized some key areas. Areas that will be invvolved in parallelization, but parallelization should still be possible