improve JS lifecycle + update node.js serialport wrapper accordingly