Merged in changes to use AJAX.