simplified AJAX wrapper

as suggested by @RubenVerborgh in RubenVerborgh/promiscuous#27