Split classes into their own files and add tests