Finished basics for workflow system.

Still need to clean things up a bit, add more types, etc.