Fix a bug with event handlers. Rollback preloading.

Now it should work properly in both minified and development versions.

Preloading system was buggy in production testing. Needs some
rethinking.