Thanks for the suggestion Nick, I've moved the macro definition up towards the top of ob.el, and for good measure I am now autoloading it. After this change I am able to call both ob-execute-subtree and ob-execute-buffer without error on the following simple Org-mode file