bug-36 add update mode and move index.js as a standalone exeutable