Added a profile button in test.js which dumps results to profile.log