Cleaned up JavaScript files and added comments