Reverting the earlier Node.js version upgrade and several bugfixes

The commit messages should be quite descriptive about the problems we have come across.