Fix extern methods & add toJSON(), recompile dist.