Use CallEvent and CallDescription everywhere. Unhardcode argument numbers in AcquireLock() etc. Have a list of supported functions in one place. Other misc cleanup. No functional change intended anywhere.
Don't forget to check that the function is a global C function in post-call.
How about committing the refactor of the code without test modifications. And committing changes to the test separately?
Remove the changes in tests for now. I guess they'd need more cleanup anyway.