Split the Core class

Although the logic stays the same, and everything is put back together
in a single class.