Updated -- appears to be mostly working.  Fun exercise. Still needs documentation, though