adds atomic profile update function

Yes, I added request because I don't know the old-school http-only way of sending a POST with a JSON body :-P
Hoist this out of here (maybe up to the top of the file?) so this doesn't get redefined every time the function is run. Speed the day when `const` actually works in V8!