Workflow API

Tests no longer broken. Still needs comments, but merging sooner rather than later to stop blocking folks.