Move state/api and state/apiserver to top level

This is a follow up to #653 that finishes the general code migration.