Major repairs to the program

Remade System.h/System.cpp with new/changed classes. New program logic.