Moved javascript to the top of the file and precompiled application