Refactor and simplify Avro IPC and OAuth2 code.