Sweettea's AJAX changes

Opening this pull request instead, since this branch has been rebased correctly to branch off of main-proposed. This is a new version of pull request #425.