Got the general formulation working.  Time to move this to the main branch.