Improved build script to allow for debug mode of node