Save and restore the globally defined "define" function, as per the suggestion by @joelrbrandt.