Switched to a queue to be flushed once full instead of appending to a file, removed base64 encode/decode