There isn't a universal way to wire such things, so unless you have info on exactly which model / brand / etc it is, and someone happens to have the same one to trace out the wires on (or there's a diagram already out there for it), then you're going to have to create a way to wire it up that makes it do the things you want.
My first recommendation is to go to Teklektik's 2WD Yuba Mundo bike thread, where he has some detailed info on that, and links to his other thread that details wiring up lighting, turn signals, brake lights, etc.
There's probably also diagrams elsewhere, but that's the most detailed setup I know of here on ES, since I never have documented mine.
Something to note is that if it has a tail/brake light, with three wires, one is for tail, one is for brake, and one is common. If it's incandescent it doesnt' matter which is which, but if it's LED then the common could be ground *or* 12v, and whichever it is then the other two will be opposite of that to activate them. If it's separate lights for tail or brake then that's easier.
Same thing for marker/turn signal units that are three-wire.
If the wiring was literally melted, you'll want to test and verify all of the things on there are not shorted internally or to the frame, because that could've been caused by such a short.
Battery meters are usually just wired across battery input to controller, both plus and minus.
Amp meters are usually wired in series with the negative battery wire to controller, but it depends on if they ahve external shunts, etc., and if they are separately powered by either the 12v or the battery voltage. If it doesn't say you may have to open it up to trace it's wires.
Keyswitches are usually wired so they connect/break the battery postiive input to the DC-DC and to the KSI/doorlock wire on the controller.