Fixing lots of little bugs after the AmoebaJS conversion. In good shape now, considered almost done