Refactored JavaScript.
Use django's new StreamingHttpResponse.