Update to app_id / app_instance_id (partially) and mangle to be PEP8 compliant.