Add debug mode to js #38, log fix for plugin api #43