Adding AJAX closure support

Signed-off-by: Jeremy Massel <jeremy@habithq.ca>