- Renamed variables in the Javascript code for consistency
- Some more minor cosmetic changes to the Javascript