add function wrapper around whole script, change how automatch button is added so it works in the main extension
unwrap the callback functions
send JSON instead of XML response, fix problem where client sees null response