Refactor ajax code to enable usage of decorators per data_provider.

Also fixed bug with contest_decorator.