JavaScript library to instrument method calls