feat(logger): extract log-writing and manipulation functions into module.

extract log-writing into logger module to handle all interactions with the logfile.
fix(pings): return last ping time over current time

in ping emit, emit the time of the last ping rather than the current time. This
should improve the catch-up pings, as currently they show the time when the computer
is brought back from sleep.
chore(gitignore): add log.json
Merge pull request #1 from sjmarshy/refactor/logger

Refactor/logger