first pass, toward #141. Maybe?

Do not merge, but have a look at section 4.1 on this branch. What does anyone think?