Separated classes into individual files, fixed minor bugs.