Cleanup and document base.js class.