More cleanup, and parameterize the current branch

This will work on any branch, which makes it easier to develop this
stuff in a branch.