convert source to js, and a bunch of bug fices
gems