Update main.c

Cleaned up handle_minute_tick.  Moved static variables to file scope (makes more sense to make these variables file scope, because they are being used in file scope).  Changed text handling to use more of the standard library.