Agree with Johngaltline and Aussteve. I have built four layouts, and one thing is for sure-you ain't gonna get straight lumber 'cause it doesn't exist. I agree that you should pick through the stock until you find some that are reasonably straight. This may take awhile. The supports are not critical, the tops are.
For my large shelf layout, I wanted the boards to look like the finished wood it would be screwed to. I sanded, stained, sealed and sanded three times, then triple-doweled them to keep them as straight as possible. I achieved a success that could be deemed more than reasonable. Anyway, the bottoms (of the shelves) shine like a baby's butt.
For the table layout, I simply screwed them down to the 2X4 framework. I prefer pine to plywood, but agree that plywood is best for the large surface areas.
The shelf has remained, as assembled, for two years. The table hasn't moved a bit in eight.
Good luck,
Jerry