Split the Node.js loader's shutdown routine to its own function
Split the Node.js loader's LineReader to its own file and add unit tests for it