Add logging + other minor changes

Added the logging module so that exceptions that stop the program will
be recorded (I was incorrectly using sys.err instead before). Also fixed
not providing the correct arguments to instantiate_lines when a new day
starts (Which may be why it wasn't working before), and fixed a bug
caused by starting the program after midnight on the first day of a
month.
The parse_args function was also relocated so that everything is in
alphabetical order.