updated script.js

Added more comments to make the code easy to understand.

Changed the calcGradePercent function to only require 2 parameters thus
making it more reusable