Code cleanup, better polling of AJAX requests. Fixes #1.