main.c, httpd.c, log.c: Separate logging logic, day log

Logging-related stuff gets its own file that handles the ring buffer
logic and has two functions getlog() and getdaylog() to return two
buffers with sorted entries for the last LOG_S seconds and 24 hours,
respectively.