by slashrsm: Dynamically register JS callbacks.