Move javascript source expansion into preprocessor

This ensures that the checksum is calculcated correctly based on the expanded source.

Caveat: every single event (non-sampled) now must be expanded