Use UCI for setup state

And add tests for the two relevant endpoints.

Fixes #183.