One possibility is something like the Centipede shield:
That has 64 pins that can be configured for input or output individually (it uses 4 x MCP23017 I2C expander chips).
It has an address jumper so you can actually have a second one on the same I2C bus.
An alternative is to use the 74HC595 (or similar) shift registers. This post shows 4 of them controlling 32 LEDs:http://www.gammon.com.au/forum/?id=11518
You can always use more than 4, daisy-chained together.
There are also such things as input shift registers, like the 74HC165, for your inputs.
You will need, as you acknowledge, some way of converting logic level outputs to drive your solenoids and things. Looks like you will need a lot of them. MOSFETs are probably what you want, as they act more like switches than amplifiers. I think you can get them in packages (eg. 4 in one IC) if you are trying to run a lot of them.