Got rid of the compiler errors and fixed misc bugs.  This version is in much better shape.