Monkey patching JavaScript for fun and profit