Split classes into individual files. Add some tests