Fixed a few things, added global defs file for functions and definitions relied on by setup scripts, and ruby set up should now work (untested though).