first cut

a rough cut to show a working version. I'll add more details and docs
later. Probably.