Refactored to accept a `formatFn` for logging.

Also, fixed file.contents size calculation. Buffer.byteLength assumes
'utf-8' encoding, which produces inaccurate results for files that have
been compressed (e.g. gzip).
Simplify and improve.
No longer necessary
Only log when there's a difference.
Merge branch 'feature/take-format-fn'