Add basic options infrastracture

The plan is to use this to make state option setting and getting more manageable and flexible.

One advantage to this is that we can allow all state options to be given as functions that return promises.