wip: lots of tests passing. end in sight.