Nate, the small box bolted to the frame should be the voltage regulator. The electric start version should have 4 wires leading to a single plug into the wiring harness. The battery should be grounded to the frame, the starter should be grounded to the frame, the voltage regulator - by virtue of being bolted to the frame - is also a point of ground, and there should be a wiring harness ground in the same vicinity as the voltage regulator. Bad voltage regulator should not affect engine operation.
Do you have a wiring diagram? If so, trace out your wires to be sure everything is connected properly. Check the 5 pin connector at the engine to make sure that it is seated properly and all the pins are making good contact. Check the output on your lighting coil to confirm that it is making the proper voltage - 14 to 16 volts give or take. it sounds like you have a bad ground somewhere and/or one of the elements in your headlamp is burned out. If light intensity varies excessively with engine rpm and bulbs burn out there is likely a problem with the voltage regulator.