"When dismantling the bike for work, how do you keep track of where all the nuts and bolts go?"
I have a garage full of bikes, and it's hard to remember where every piece of hardware goes, especially when you frequently work on totally different bikes.
I made up a Hardware Location Chart for each bike, made of carboard cut from a manilla file folder. On each sheet I drew a lot of squares, usually about 3" square, but some are larger or smaller. I select the proper chart for the bike I'm working on, and lay it on a shelf or desk, somewhere it won't be bumped around or get in my way. Then each time I remove something from the bike, the nuts and bolts go in the appropriate squares. The first square, for example, is marked SEAT, since that's usually the first item to be removed. The two seat bolts go in that square. Two other squares are marked SHROUDS, UPPER, and SHROUDS, LOWER since the upper and lower shroud bolts are often different. In the box marked MUFFLER I added a note that says "Long bolt on top", since the upper muffler bolt is longer than the lower muffler bolt.
If you make up the chart as you work on the bike, you even form a sequence reminder to help prevent things like putting the seat back on before the side plates, etc.
If you think it's hard to keep track of the nuts and bolts for a dirt bike, try taking a GL1800 Gold Wing apart! There's a lot of hardware when you're dealing with features like horns, turn signals, electrically adjustable headlights and rear suspension, Cruise Control, stereo, CD player, CB radio, trailer hitch and wiring, rider/passenger communications, back rest, arm rests, and much, much more.