Implement registration of functions/methods in Scriptable and calling them from javascript