Added support for long-polling. Fixed bugs. Runs faster