Moved JavaScript components to their own files.