Logic Cleanup for Workflows

Fixing up workflow logic to conform to our entity model diagram.
Workflow is now its own table that refers to the allowed statuses table for its logic.
You can create/delete workflows from the navigation bar.

TODO: Let tasks choose what workflow to be assigned to
TODO: Allow workflows to be edited
TODO: Let packages figure out next state from current state
TODO: Make a better UI to create/edit your workflow, perhaps checkboxes as proposed by Weinan