Added functionality to start a new day

Also created a function called run in the main file that takes care of
the program's main loop, plus various other small changes