This is how we figure out where the script itself is.. I don't like these hacks but they are at least partially needed..

My real fix is to have a node "installer" built into gaia which will fix gaia to a specific version of node and get an environment setup without any global dependencies (you still need bash). The installer will download the right version of node for you (4mb~) and we can use nicer platform independent apis without global stuff