Rewrote entirely to be more purely functional.  No more graphical version for now though.