Optimize memory management

There were a number of cases that were wasting memory and causing large diffs to hit environmental memory limits. Greatly reduced this by tracking the value content in an integer counter and then doing a pass of the result set to reconstruct the value parameter after we have found the final solution. This avoids the large memory (and CPU) overhead associated with storing the temporary value solutions, many of which will be thrown out.

On my local dev machine this dropped exec time for #27 from 18min to 2min 5s.

Fixes #27 (or improves as best as the algorithm allows for)