Many issues fixed.  Looks like (close to) a working version now.