Add keep-alive header (and misc cleanup)