Just in case you haven't figured out what the black wires are for.. It's the safety interlock circuit.
From bmw:
12.1. High voltage interlock loop The high-voltage interlock loop is used to protect individuals when working on or at the high-voltage components. Via the high-voltage interlock...