various fixes, updated bin
wrapping scripts in self invoking functions to make jsdoc happy
minor doc fix