More js

Refactored more JS and made the point calculator match the US formula from the wiki.