Update base.js

I added a few comments here mostly for documentation.