Cut down some code

This is getting long. Cut out some funky stuff, unfinished things, and
tried to organize the flow (outlined in workflow.md).