Added first version of table-based valve.

This is for #205.