Use a hard, inexpensive local wood, without large pores. Hard, since they will get banged around. Pores will allow the wood to trap bacteria, dirt where you don't want it.
Maple is my first choice. Second choice might be birch, sycamore, or alder, if you have a source for them. Poplar is not bad either - cheap, reasonably tough. Cherry would work too. Much depends on what you can find locally. Do NOT go to your local big box store (Home Depot, etc.) to buy hardwood. Hardwood bought there will be quite expensive for what you get.
Woods that I would NOT use are imported exotic woods. These can often cause allergic reactions. Another wood to be avoided for this purpose is walnut, which might cause reactions in some.
Use wood coloring, rather than paint. Paint can chip off, and may not be food safe. And be careful with stains, since many of them will not be food safe. Wood dyes, like aniline dyes, may also be something I would not put in my child's mouth. For a coloring, I would use simple food coloring.
If the glue is really thick, it'll take a lot of remover and work to remove. 400 grit paper is much too fine to remove adhesive. Use something closer to 100 grit sandpaper. Use a sanding block so it doesn't cut into the leg edges, and be careful to match the angle of leg end so you are just removing adhesive, not wood. In particular, do not allow the paper to cut wood in a direction that could cause the wood to splinter outwards. This is unlikely a problem as long as you are not too aggressive, because the wood is probably hardwood and not prone to splintering. If the paper gums up with glue, change to fresh paper.
Even taking your time and being careful, this will be much faster than chemical removers. As soon as you see you are starting to cut into wood, then switch to chemical remover to get the rest. Depending on the new adhesive, if there is any, you may need to seal any raw wood to provide for maximum adhesion.
The nail on pads work well, but they are more visible, so not always suitable.
Best Answer
Solvent based primers are the way to go on top of Poly or other clear coat. If you don't want to deal with the smell though you will need to sand it well and apply a surface prep fluid. I personally use a product called no sand (yes I still sand before I use it). This softens the top coat you are working with allowing a latex paint to stick better. It will still not be as durable as it would with a solvent based primer.
If this is a high traffic shelf (a bookshelf that is used often for example) I would suggest finding a time you can sleep in another room and use the better primer, that said if it just holds pictures or decorations then you can get away with the method mentioned above just fine.
Make sure you read the directions on the no sand well.