add JSdoc to resources.js, make some cleanups