Total rewrite to be more modular and support raw json logs from nginx